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´ú碼
¡¡¡¡function getAuth()
¡¡¡¡{
¡¡¡¡var authStatus="<%=GetAuthStatus()%>";
¡¡¡¡return authStatus;
¡¡¡¡}
¡¡¡¡Èç¹ûÔÚjavascript調ÓõÄc#·½·¨沒Óзµ»ØÖµ£¬¿ÉÒÔÔÚÒ»ÃæÖзÅÒ»個button£¬È»ááÔÚbuttonµÄ單擊ʼþÖÐÈ¥寫Ïë×öµÄÊÂÇ飬ÔÚ¿Í戶¶ËµÄ腳±¾ÖÐ寫ÏÂÈçÏ´ú碼¾Í¿ÉÒÔÁË
¡¡¡¡document.all("button1").click();
Ïà¹ØÎĵµ£º
9¡¢YUIµÄдÀ෽ʽ
ÕâÀïÒýÈëµÄÊÇYUI 2.7.0°æ£¬Ö»ÐèÒýÈëyahoo.js¡£YUIÒýÈëÁËÃüÃû¿Õ¼ä£¬ÀàËÆÓÚjavaµÄ°ü¡£ÒÔÏÂyahooµÄ¹¤¾ßº¯Êý°ü
YAHOO.namespace
YAHOO.lang
YAHOO.lang.hasOwnProperty
YAHOO.lang.extend
YAHOO.lang.augment
YAHOO.log
YAHOO_config and YAHOO.env
YUI Module Names
дÀ෽ʽ£º
//¶¨Òå°üà ......
10¡¢mootools.jsµÄдÀ෽ʽ
mootools.jsµÄ×îа汾ÊÇ1.2.3,ÕâÀïʹÓõÄÊÇ1.2.0¡£mootool±»Éè¼Æ³É·Ç³£½ô´ÕµÄ£¬Ä£¿é»¯µÄ£¬ÃæÏò¶ÔÏóµÄµÄjs¿â¡£mootoolÖÐдÀàÓÃClassÀà¡£ClassÀàÓÉNativeÀànew³öÀ´µÄ£º
/*
*Script: Class.js
*/
var Class = new Native({
name: 'Class',
initialize: function(properties){
propert ......
C#ÖжÔbaseµÄ½âÊÍ(Òý×ÔMSDN):
base ¹Ø¼ü×ÖÓÃÓÚ´ÓÅÉÉúÀàÖзÃÎÊ»ùÀàµÄ³ÉÔ±£º
µ÷ÓûùÀàÉÏÒѱ»ÆäËû·½·¨ÖØÐ´µÄ·½·¨¡£
Ö¸¶¨´´½¨ÅÉÉúÀàʵÀýʱӦµ÷ÓõĻùÀ๹Ô캯Êý¡£
»ùÀà·ÃÎÊÖ»ÄÜÔÚ¹¹Ô캯Êý¡¢ÊµÀý·½·¨»òʵÀýÊôÐÔ·ÃÎÊÆ÷ÖнøÐС£
´Ó¾²Ì¬·½·¨ÖÐʹÓà base ¹Ø¼ü×ÖÊÇ´íÎóµÄ¡£
ÔÚ±¾ÀýÖУ¬»ùÀà Person ºÍÅÉÉúÀà Employee ¶¼ÓÐÒ»¸ö ......