Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c#ºÍjavascript½»»¥

 c#ºÍjavascript½»»¥
ÔÚasp.net¿ª·¢ÖУ¬¾­³£»áÓõ½ºǫ́ºÍǰ̨µÄ½»»¥£¬¾Í´Ë×ܽáÁËÒ»µãc#ºÍjavascriptÏ໥²Ù×÷µÄ·½·¨
1.ÔÚºǫ́c#´úÂëÖе÷ÓÃjacascriptµÄ·½·¨
javascript´úÂ룺
<script type="text/javascript" language="javascript">
    function test()
    {
        alert("oec2003");
        return false;
    }
</script>
c#´úÂ룺
protected void Button1_Click(object sender, EventArgs e)
{
    ClientScript.RegisterStartupScript(this.GetType(), "clear", "<script>test()</script>");
}
2.javascriptÖе÷ÓÃc#·½·¨
Èç¹ûc#Öеķ½·¨Óзµ»ØÖµ£¬¿ÉÒÔÓÃÏÂÃæ·½·¨
c#´úÂë
public string GetAuthStatus()
       {
           ViewState["Auth"] = "Red";
           return ViewState["Auth"].ToString();
       }
javascript´úÂë
<script type="text/javascript" language="javascript">
    function getAuth()
    {
        var authStatus = "<%=GetAuthStatus()%>";
        return authStatus;
    }
</script>
Èç¹ûÔÚjavascriptµ÷ÓõÄc#·½·¨Ã»Óзµ»ØÖµ£¬¿ÉÒÔÔÚÒ»ÃæÖзÅÒ»¸öbutton£¬È»ºóÔÚbuttonµÄµ¥»÷ʼþÖÐȥдÏë×öµÄÊÂÇ飬ÔÚ¿Í»§¶ËµÄ½Å±¾ÖÐдÏÂÈçÏ´úÂë¾Í¿ÉÒÔÁË
document.all("button1").click();


Ïà¹ØÎĵµ£º

javascript ÉèÖÃcookie×¢ÒâÊÂÏî

javascript ÉèÖÃcookie×¢ÒâÊÂÏî
javascript ÉèÖÃcookie×¢ÒâÊÂÏî
ÔÚJavascript ÖУ¬cookie ¿ÉÒÔͨ¹ý document.cookie½øÐÐÉèÖ㬵±ÉèÖöà¸öcookieʱä¯ÀÀÆ÷»á×Ô¶¯°Ñ
ËüÃÇÓ÷ֺŸô¿ª¡£ÈçÏ£º
document.cookie = 'cookie1';
document.cookie ='cookie2';
alert (document.cookie) ;//Êä³ö cookie1 ; cookie2
µ«ÊÇÈç¹û°ÑµÚ ......

javascript ´°¿Ú

//¹Ø±Õ,¸¸´°¿Úµ¯³ö¶Ô»°¿ò,×Ó´°¿ÚÖ±½Ó¹Ø±Õ
this.Response.Write("<script language=javascript>window.close();");
//¹Ø±Õ,¸¸´°¿ÚºÍ×Ó´°¿Ú¶¼²»µ¯³ö¶Ô»°¿ò,Ö±½Ó¹Ø±Õ
this.Response.Write("");
this.Response.Write("{top.opener =null;top.close();}");
this.Response.Write("");
//µ¯³ö´°¿Úˢе±Ç°Ò³Ãæwidth=20 ......

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

Javascript »ñÈ¡radiobuttonlist£¨µ¥Ñ¡¿ò£©µÄÖµ

Javascript  »ñÈ¡radiobuttonlist£¨µ¥Ñ¡¿ò£©µÄÖµ
 function check() {
                var RadioButtonList1 = document.getElementById('<%=RadioButtonList1.ClientID%>');
        ......

JavascriptʵÀý½Ì³Ì(6) ÀûÓÃJavascript½øÐÐÃÜÂë±£»¤

Ëæ×Å»¥ÁªÍøµÄ·ÉËÙ·¢Õ¹£¬µØÇò±äµÃÔ½À´Ô½Ð¡£¬ÈËÃÇ¿ÉÒÔ¿çԽʱ¼äºÍ¿Õ¼äµÃ½çÏÞ½øÐн»Á÷ÓÚºÏ×÷¡£µ«ÊÇËæÖ®Ò²²úÉúÁËһЩËÁÒâ¸ãÆÆ»µµÄºÚ¿Í£¬Õâ¾ÍʹµÃ³ÌÐòÉè¼ÆÈËÔ±ÔÚ±àÖÆÓ¦ÓóÌÐòÖÐÒª¿¼Âǵ½ºÚ¿ÍÏ®»÷Õâ¸öÎÊÌ⣬ËùÒÔ×ÔÈ»¶øÈ»µØ¾Í»áÏëµ½±£»¤¡£±¾½Ú½Ì³Ì½«½ÌÄãÔõÑùÀûÓÃjavascript½øÐÐÃÜÂë±£»¤¡£ÀûÓà JavaScriptÀ´¶ÔÍøÒ³½øÐÐÃÜÂë±£»¤Óм¸ÖÖ· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ