<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Tao

    Tao obeys its own inherent Nature

    Add javascript to the client

     

    Show how to add script to the client in aspx file.

    /// <param name="rbl">RadioButtonList to apply script to</param>
    /// <param name="page">The Page the script is going to be appended to</param>
    /// <param name="script">The script to append</param>
    public static void SetRadioButtonListItemScript(RadioButtonList rbl, Page page, string script)
    {
    for (int idx = 0; idx < rbl.Items.Count; idx++)
    {
    RegisterClientObjectFunction(page, rbl, idx, script);
    }
    }

    /// <param name="page">The Page the script is going to be appended to</param> /// <param name="rbl">RadioButtonList to apply script to</param> /// <param name="idx">the index of the radio button</param> /// <param name="script">The script to append</param> static private void RegisterClientObjectFunction(Page page, RadioButtonList rbl, int idx, string script)
    {
    StringBuilder sw = new StringBuilder();
    if (!page.IsStartupScriptRegistered(rbl.ClientID + "_" + idx.ToString() + "script"))
    {
    sw.Append(@"<SCRIPT>");
    sw.Append(@"document.getElementById('" + rbl.ClientID + "_" + idx.ToString() + "').onclick=function() {" + script + "return true;}");
    sw.Append(@"</SCRIPT>");
    page.RegisterStartupScript(rbl.ClientID + "_" + idx.ToString() + "script", sw.ToString());
    }
    }

    static private void RegisterClientObjectFunction(Page page, CheckBox chk, string script)
    {
    StringBuilder sw = new StringBuilder();
    if (!page.IsStartupScriptRegistered(chk + "script"))
    {
    sw.Append(@"<SCRIPT>");
    sw.Append(@"document.getElementById('"+chk.ClientID + "').onclick=function() {" + script + "return true;}");
    sw.Append(@"</SCRIPT>");
    page.RegisterStartupScript(chk.ClientID + "script", sw.ToString());
    }
    }

     

    posted on 2007-08-30 18:34 wade 閱讀(213) 評論(0)  編輯  收藏 所屬分類: Dot.net 、Javascript


    只有注冊用戶登錄后才能發(fā)表評論。


    網站導航:
     

    導航

    <2007年8月>
    2930311234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678

    統(tǒng)計

    常用鏈接

    留言簿(7)

    隨筆分類

    隨筆檔案

    相冊

    Photo

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产综合激情在线亚洲第一页| 在线综合亚洲欧洲综合网站| 久久一区二区免费播放| 亚洲高清成人一区二区三区| 国产亚洲综合精品一区二区三区| 国产成人精品男人免费| 午夜亚洲WWW湿好爽| 亚洲成a人片在线观看日本麻豆| 老司机午夜性生免费福利| 亚洲国产高清在线一区二区三区| h视频免费高清在线观看| 亚洲精品国产精品乱码不99| 久久99青青精品免费观看| 亚洲精品动漫在线| 一二三四免费观看在线电影| 亚洲人xxx日本人18| 日本免费网站观看| 一级特黄色毛片免费看| 亚洲第一AAAAA片| 国产91色综合久久免费| 亚洲第一街区偷拍街拍| 亚洲精品成人片在线观看| 在线成人精品国产区免费| 亚洲综合免费视频| 在线永久免费观看黄网站| 久久嫩草影院免费看夜色| 亚洲网址在线观看| 又爽又黄无遮挡高清免费视频| a毛片免费全部在线播放**| 亚洲大尺码专区影院| 亚洲AV中文无码乱人伦| 成全在线观看免费观看大全 | 国产香蕉九九久久精品免费| 亚洲AV综合永久无码精品天堂| 亚洲男人天堂2020| 日本最新免费网站| www.av在线免费观看| 亚洲精品成人久久| 亚洲精品国产V片在线观看| 亚洲精品在线免费看| 男女交性无遮挡免费视频|