我的需求是这样的:
从弹出窗体中返回一个值,通过调用js赋给父窗体的一个TextBox,然后根据这个TextBox中的内容,再调用函数从数据库中查询其他数据,赋值给一个DropDownList,可是现在无法触发TextBox的TextChanged事件,不知有什么好办法?
从弹出窗体中返回一个值,通过调用js赋给父窗体的一个TextBox,然后根据这个TextBox中的内容,再调用函数从数据库中查询其他数据,赋值给一个DropDownList,可是现在无法触发TextBox的TextChanged事件,不知有什么好办法?
解决方案 »
- 不显示删除回复显示所有回复显示星级回复显示得分回复 .net 后台给js级联的select 下拉框赋值
- |zyciis| 在将一段文本输出为input text 的value要注意哪些转义字符,谢谢
- gridview.row.count 问题 在线等
- 求一个联合查询语句 sql
- 今天12点34分56秒是一个神奇的时刻。因为今天是09年08月07日。按时间格式看:12:34:56,07/08/09。这种123456789在我们有生之年再也
- 怎么引用普通的DLL
- 页面递交问题:TextBox填完后直接按回车,结果往往触发其他几个按钮的事件..如何处理?
- C#读取地址栏中的全部内容,新手,求解释
- 怎样把从文件服务器上文件下载到客户端
- TreeView没有显示树型,都显示在同一行上了?谢谢
- 取值问题
- GridView跳回时,鼠标定位问题
AutoPostBack设为true
OnTextChanged只能在失去焦点时触发:
试试在弹出窗体js赋值时,parent.document.getElementById("TextBox1").blur();
父页面:
function showChild()
{
var url = "Test.aspx";
var width=600;
var height=500;
var retValue = window.showModalDialog(url, "", "dialogWidth:"+width+"px;dialogHeight:"+height+"px;status:yes;directories:yes;scrollbars:yes;Resizable=yes;");
if( retValue != null )
{
document.getElementById("TextBox1").value = retValue;
}
}
子页面:
function ReturnValue()
{
var txtvalue=document.getElementById("Text1");
window.returnValue = retArr;
self.close();
}
<select id="Select1">
<option></option>
</select>
protected void Page_Load(object sender, EventArgs e)
{
}
static string a = "" ;
protected void Button1_Click(object sender, EventArgs e)
{
a = "1";
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
string strCnn = "Data Source=.;Initial Catalog=book;Integrated Security=True;";
SqlConnection ACconn = new SqlConnection(strCnn);
string ACsql = "select *from book where id='" + a + "'"; SqlDataAdapter da = new SqlDataAdapter(ACsql, ACconn);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}可以参考一下!