同桌上课用手指进去了好爽_欧美丰满熟妇xxⅹⅹ性大i_成人av天天日天天拍拍_猛男gay帅男gay男男同志_欧美va天堂在线观看_人妻无码av中文系列三里桃花_亚欧免费无码在线观看_久久久精品国产亚洲av水_日韩在线免费看污污污_2021无码专区人妻系列日韩

首頁 優(yōu)化推廣 ASP.net中aspx與cs函數(shù)的互調(diào)

ASP.net中aspx與cs函數(shù)的互調(diào)

來源: | 時間:2014/6/13 9:37:09 |

之前,因為不知道aspx中的script怎么調(diào)aspx.cs中的函數(shù),無法操作GridView控件,無法讀取控件數(shù)據(jù)集信息;因為不知道aspx.cs函數(shù)怎么調(diào)用aspx中script中的函數(shù),無法設(shè)置<div>等的屬性。通過互調(diào),可以方便解決這兩方面問題。

aspx前臺的script函數(shù),調(diào)用aspx.cs中后臺函數(shù):

aspx:

<script type="text/javascript">
  function   FrontFunction()  
    {   
        var   RetStr=<%=BehindtFunction()%>;   
        alert(RetStr);  
        //window.returnValue   =   RetStr;  
        //window.close();
        //alert("000");
    }  
</script>

aspx.cs:

protected string BehindtFunction()

{

       //代碼

       return "空";//需要有返回值

}

 

aspx.cs中后臺函數(shù),調(diào)用aspx前臺的script函數(shù):

aspx.cs:

protected stringBehindtFunction(object sender, EventArgs e)

{

       //代碼

       ClientScript.RegisterStartupScript(this.GetType(), "clear", "<script>FrontFunction()</script>");

}

aspx:

<script type="text/javascript">
  function   FrontFunction()  
    {   

        mask.style.visibility = 'visible';
        Div2.style.visibility = 'visible';
        return false;
    }  
</script>

<div id="mask"></div>

 

服務(wù)熱線

153 8323 9821

功能和特性

價格和優(yōu)惠

網(wǎng)站和維護(hù)

推廣和優(yōu)化

微信服務(wù)號