选择框触发dopostback事件

1:选择框页面
选择页面JS触发控件的fireEvent事件:
string js= "window.opener.document.Form1." + controlID + ".value='" + des + "';window.opener.document.Form1." + controlID +".fireEvent('onchange')";

2:设置控件属性AutoPostBack="true" 并添加事件onchange="javascript:__doPostBack('controlID','');"
    如:
<asp:TextBox id="TextBox2" 
onclick="javascript:window.open('./SelectData.aspxview=BasicView'+'&amp;id=TextBox2'+'&amp;tablename=BW_BasicData_MaterialGroup','Information','width=415,height=320,toolbar=no,directories=no,scrollbars=no,resize=no,menubar=no,status=no')"
onchange="javascript:__doPostBack('TextBox2','');" runat="server" AutoPostBack="True"></asp:TextBox>

posted on 2007-12-06 15:54  heart-in-sky  阅读(231)  评论(0编辑  收藏  举报