懒得打开.net试函数,不过变量是可以的,首先一点就是,要把函数声明为public,否则根本没有权限调用。

解决方案 »

  1.   

    function ZipSelect_Click()
    {
    var strZipNo;

    strZipNo = window.document.getElementById("ZipFront").value + window.document.getElementById("ZipBack").value;
    if(<%=CheckZipNo(参数怎么传??)%> == 0)//可以写定数,但是变量呢??
    {
    alert("cool");
    }
    window.open ("../../Address/Select.aspx?Postcode=" + strZipNo + "&AddressKbn=01", "height=655, width=645, toolbar=no, directories=no, menubar=no"); 
    }
      

  2.   

    你把你要Javascript调用的改为C#调用
    用Import引入一下
    <%@Import Namespace="System.Data"%><script language="C#">
    function ZipSelect_Click()
    {
    }
    <script>
      

  3.   

    这个我都知道,关键是怎么在javascript里面往方法传参数
      

  4.   

    可以用ajax来访问~postStr="Postcode=" + strZipNo + "&AddressKbn=01";
    new Ajax.Request(
    'Select.aspx',
    {method: 'post', parameters: postStr, onFailure: function(request){ alert('失败'); }, onSuccess: function(request){alert('成功');} });
      

  5.   

    若不用ajax呢?看看一下方法var strZipNo;
    var iResult;strZipNo = window.document.getElementById("ECTextBoxZipFront").value + window.document.getElementById("ECTextBoxZipBack").value;iResult = <%=DataCheck.ZipNo("[\"strZipNo\"]")%>;
      

  6.   

    但是这样的话iResult值总是返回-1(就是错误),即使输入正确了。