Asp.Net小技巧之在client端调用server端事件

来源:互联网 发布:多玩魔盒mac版国服 编辑:程序博客网 时间:2024/05/21 10:38
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

  
   Asp.Net小技巧之client端调server端事件

   string strCMD = Page.GetPostBackclientHyperlink(ControlName,Parameter);

   OtherControlName.Attributes.Add("clientEventName", strCMD);

   小注:

   在上述两行代码中,利用Page.GetPostBackclientHyperlink方法来取得对服务器控件事

件的一个引用,然后通过页面上其它控件的Attributes.Add方法来添加一个客户端事件,以

便能调用server端事件。这样便可以完成在client调用server的事件的功能。
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击