且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将值从Javascript传递到ASP.net控件

更新时间:2023-10-07 11:27:10

以这种方式重写函数
Rewrite your function this way
function SelectAndClose() {
            txtValue = document.getElementById('_browseTextBox');
        if ((window.opener != null) && (window.opener && !window.opener.closed)) {
               window.opener.InvokeParent(txtValue.value);
        }
            window.close();
            return false;
        }


现在在父页面.aspx的脚本块中编写以下函数


Now Write Following Function in script block of .aspx of Parent Page

<script type="text/javascript">
    function InvokeParent(varValue){
      if(varValue != ""){
        // Write Required Statements to perform whatever operation
       }
    }
</script>