asp.netµ÷ÓÃjs½Å±¾·½·¨
1¡¢Ö±½ÓÔÚǰ̨µ÷Óà javascript º¯Êý
ºÜ¼òµ¥,ÔÚ head ÔªËØÖ®¼ä¼ÓÈë script ÔªËØ,½« type ÔªËØÉèÖÃΪ " text/javascript "
Èç:
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
<head runat="server">
<script type="text/javascript" >
function ShowName(str)
{
alert("ÄúµÄÃû×ÖΪ:("+str+")");
}
</script>
<title>using javascript</title>
</head>
Ö®ºóÔÚbody ÔªËؼä,ͨ¹ýʼþÀ´·ÃÎÊ Èç Ҫͨ¹ýbutton1 µÄµ¥»÷ʼþ(onclientclick)À´·ÃÎÊ javascript º¯Êý
ʾÀýÈçÏÂ:
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
<asp:Button ID="Button1" runat="server" Text="Button" onclientclick="ShowName('XXX')" />
ÕâʱÔËÐÐÏîÄ¿,µ¥»÷ buttonʱ,»áÏÔʾ"ÄúµÄÃû³ÆΪXXX"
Õâ¾ÍÊÇÒ»¸ö¼òµ¥µÄjavascript º¯Êý.
2¡¢ÔÚǰ̨ͨ¹ý jsÎļþ µ÷ÓÃ
·½·¨Óë £¨1£©Ò»Ñù Ö»²»¹ýÐèÒªÖ¸¶¨ .js Îļþ
ʾÀýÈçÏÂ:
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
<head runat="server">
<script type="text/javascript" src="JScript.js">
</script>
<title>using javascript</title>
</head>
Ö®ºóÔÚbody ÔªËؼä,ͨ¹ýʼþÀ´·ÃÎÊ Èç Ҫͨ¹ýbutton1 µÄµ¥»÷ʼþ(onclientclick)À´·ÃÎÊ javascript º¯Êý
ʾÀýÈçÏÂ:
//´Ëʱ .jsÎļþÖбØÐëÓÐ ShowName ·½·¨
<asp:Button ID="Button1" runat="server" Text="Button"
3¡¢ÔÚºǫ́µ÷Óà javascript º¯Êý,º¯ÊýдÔÚ .jsÎļþÖÐ,µ«²¢Ã»ÓÐÔÚǰ̨¶¨Òå
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
//»ñµÃ.jsÎļþ
string myscript = "JScript.js";
//×¢²á.jsÎļþ, Èç¹û´Ëʱ²é¿´Ô´Âë,»áµÃµ½ÈçÏ´úÂë
//<script> src ="JScript.js" type="text/javascript"><script>
Page.ClientScript.RegisterClientScriptInclude("myKey", myscript);
//ͬÉÏ
Button1.Attributes.Add("onclick", "showname1(123)");
onclientclick="ShowName('XXX')" />
4¡¢ÔÚºǫ́µ÷Óà javascript º¯Êý,º¯ÊýÔÚ.jsÎļþÖÐ
ǰ̨µÄhead ÔªËØ
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
<head runat="server">
<script type="text/javascript" src="JScript.js">
</script>
<
Ïà¹ØÎĵµ£º
1.¹ØÓÚ»º´æ
»º´æÉÏ£¬Êý¾Ý²ãÉϵĻº´æÊDZØÐëµÄ£¬Õâµã²»±Ø¶à˵ÁË¡£
ÁíÒ»¸öºÜÖØÒªµÄÊÇ£ºÊÓͼƬ¶Î»º´æ¡£
ÎҲο¼ÁËÀÏÕÔµÄдµÄÈýƪ¹ØÓÚƬ¶Î»º´æµÄÎÄÕ£º
ÊʺÏASP.NET MVCµÄÊÓͼƬ¶Ï»º´æ·½Ê½£¨ÉÏ£©£ºÆð²½
ÊʺÏASP.NET MVCµÄÊÓͼƬ¶Ï»º´æ·½Ê½£¨ÖУ©£º¸üʵÓõÄAPI
ÊʺÏASP.NET MVCµÄÊÓͼƬ¶Ï»º´æ·½Ê½£¨Ï£©£ºÒ³ÃæÊä³öÔÔò
± ......
½ñÌìÎÒÃǼÌÐøÍê³É Õâ¸ö MVC2 ¼òµ¥ÊµÀýµÄÊ£Ó๦ÄÜ£ºÏÔʾÃ÷ϸ¡¢Ìí¼Ó¡¢±à¼µÈ¡£¡£¡£¡£¡£
Ò»¡¢ÏÔʾÃ÷ϸ
¡¡¡¡ÔÚ MoviewsControllerÖÐµÄ Details·½·¨Àï ÓÒ¼ü--Add view£¬´´½¨Ò»¸öÇ¿ÀàÐ͵ÄÊÓͼ
¡¡¡¡
¡¡¡¡
È·¶¨ºó£¬Õâ¸öÃ÷ϸµÄÊÓͼÎļþ¾ÍÒѾÉú³É¡£¡£¡£
´Ëʱ£¬ÎÒÃÇÐèÒªÐÞ¸Ä Detials ·½·¨£¬¸ù¾Ý ´«µÝ¹ýÀ´µÄ id²ÎÊý£¬È¥Êý¾Ý¿â²éÑ ......
ÔÚ¹¤¾ßÏäÖÐÌí¼ÓÑ¡Ïî Ìí¼Ócom×é¼þ ÕÒµ½ocxÎļþ
È»ºó ÉèÖÃÄã×öµÄÍøÒ³µÄ Ãû×Ö ÔÚä¯ÀÀÆ÷ÖÐµÄ ¹¤¾ß>IEÑ¡Ïî>°²È«>¿ÉÐÅÈÎÕ¾µã
<body>
<object id="VpOcx" classid="clsid:8B832F98-B7EE-4E2B-9FB4-86FA3BA17047"
codebase="~/../Bin/VpMatrixOcxPro.ocx"
&nbs ......
WebPartManager
WebPartManager¿Ø¼þÊÇ Web ²¿¼þ¿Ø¼þ¼¯µÄºËÐĿؼþ£¬ÓÃÓÚ¹ÜÀíËùÓÐ Web ²¿¼þ¿Ø¼þ¡¢Web ²¿¼þ¹¦ÄÜºÍ Web ²¿¼þʼþ¡£
±ØÐëÏòʹÓà Web ²¿¼þ¿Ø¼þµÄÿ¸öÒ³Ìí¼ÓÒ»¸ö£¨½ö½öÒ»¸ö£©WebPartManager¿Ø¼þ¡£WebPartManager¿Ø¼þÖ»ÄÜÓÉͨ¹ýÉí·ÝÑéÖ¤µÄÓû§Ê¹Óá£
WebPartManger ÈÎÎñ
ϱíÁгöÁËÓÉ WebPartManager¿Ø¼þÖ´Ðе ......
¡¾Õª Òª¡¿ ±¾ÎÄ»ùÓÚASP.NET 2.0µÄÔ´´úÂ룬¶ÔASP.NET 2.0ÔËÐÐʱ½øÐÐÁ˼òÒªµÄ·ÖÎö£¬Ï£ÍûÄÜ°ïÖúÄãÀí½âASP.NET 2.0ÖÐÇëÇó´¦Àí¹ý³Ì¼°Ò³Ãæ±àÒëÄ£ÐÍ¡£
¡¡¡¡Ö÷ÒªÀࣺ
¡¡¡¡System.Web.HttpRuntime
¡¡¡¡System.Web.HttpApplicationFactory
¡¡¡¡System.Web.HttpApplication
¡¡¡¡System.Web.Compilation.BuildManager
¡¡¡¡Syst ......