在運(yùn)用JQury+母版頁(yè)時(shí)
發(fā)現(xiàn)JQuery 調(diào)用不了服務(wù)器控件 不能實(shí)現(xiàn)前段效果
所有使用前臺(tái)控件
要使控件值得到交互
通過(guò)森戳-萎縮思想 ....方法如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="TNT.ETourBusinessPlatform.Web.bar.test" MasterPageFile="~/MasterPage.Master"%>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<script src="../js/jquery-min-lastest.js" type="text/javas
<style type="text/css">
.l01
{
width:100px;
height:20px;
margin-top:10px;
margin-left:10px;
}
</style>
<script type="text/javas
$(function() {
$("#txt").click(function() {
alert("asdf");
})
})
</script>
<div>
<%= show_input_txt() %>
<input id="Submit1" type="submit" value="submit" />
<%=s %>
</div>
</asp:Content>
------
后臺(tái)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace TNT.ETourBusinessPlatform.Web.bar
{
public partial class test : System.Web.UI.Page
{
public string input_txt_value;
public string s;
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{ s = Request.Form.Get("txt"); }
}
public string show_input_txt()
{
input_txt_value = "呵呵";
return ("<input type=\"text\" name=\"txt\" id=\"txt\" value=\""+input_txt_value+"\" />");
}
}
}
------很詭異。
聯(lián)系客服