asp.net 程序,单击按钮时 同时实现打开页面并处理值

来源:http://blog.csdn.net/nvhaixx/article/details/12430757

 

1)在网页中添加用于处理的客户端事件:  

1 <script language="javascript" type="text/javascript">
2     function doSearchClick()
3         {
4             window.showModalDialog('需要打开的页面.aspx?传递参数=' + document.getElementById ("当前画面上的传递值").value + '','','dialogWidth=700px;      dialogHeight=500px;');
5         }
6 </script>

2)页面控件中的代码    

<asp:Button ID="btnSearch" runat ="server" text="?" CssClass="btn" OnClientClick="doSearchClick()" ></asp:Button>

3)服务器端的代码(VB.net代码)

    Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        '其他处理代码
    End Sub

  

相关资料:

 

window.showModalDialog以及window.open用法简介

JS中window.showModalDialog()详解

 

posted on 2015-03-15 22:46  华山青竹  阅读(359)  评论(0编辑  收藏  举报

导航