ASP.NETѧϰ±Ê¼ÇËÄ ¿Ø¼þʹÓÃ
ASP.net¿Ø¼þ·ÖÀࣺ
1¡¢HTML¿Ø¼þ System.Web.UI.Htmlcontrols
ÆÕͨHTML½Å±¾¿Ø¼þ£¬ÊôÓÚ¿Í»§¶Ë¿Ø¼þ£¬ÓÃÓÚ¿Í»§¶Ë½âÊÍÒ³ÃæµÄÏÔʾµÄÄÚÈÝ
Ò²¿ÉÒÔת»¯³É·þÎñÆ÷¿Ø¼þ£¬Ö»ÐèÒª¼ÓÉÏÊôÐÔ runat="server"
È磺Îı¾¿òÅäºÏ°´Å¥Ê¹ÓÃ
ÐÕÃû: <input id="txtUserName" name="txtUserName" type="text" />
<input id="btnSubmit" type="button" value="ÏÔʾ" onclick="show1()"/>
½Å±¾²¿·Ö´úÂëΪ£º
<mce:script type="text/javascript"><!--
function show1()
{
var userName = document.getElementById("txtUserName").value;
if(userName != "")
alert("ÄúÊäÈëµÄÐÕÃûÊÇ:"+userName);
else
alert("±ð¶ºÁË,Äú²»Ã»ÊäÈëÄØ!");
}
// --></mce:script>
ÔÚJavaScriptÖÐÎÒÃǸù¾ÝÔªËصÄidÀ´¶¨Î»µ½ÔªËØ£¬ÔÙͨ¹ýÔªËصÄvalue¡¢innerText¡¢innerHTML¡¢styleµÈÊôÐÔÀ´
¸Ä±äÔªËØ»ò×öһЩ´¦Àí¹¤×÷¡£ÄÇô¶ÔÓÚÏñµ¥Ñ¡°´Å¥¡¢¶àÑ¡°´Å¥µÈ×éºÏÐÔÖʵĿؼþ£¬¾ÍÒª¸ù¾ÝÆä×éÃûÀ´»ñÈ¡ÔªËØ£¬ÈçÏ£º
ÄúµÄÐËȤ°®ºÃ:<br />
<input name="hover" type="checkbox" value="tour"/>ÂÃÓÎ
<input name="hover" type="checkbox" value="net"/>ÉÏÍø
<input name="hover" type="checkbox" value="reading" />ÔĶÁ
<input id="btnHover" type="button" value="ÏÔʾ" onclick="show2()"/>
½Å±¾´úÂë:
<mce:script type="text/javascript"><!--
function show2()
{
var hovers = document.getElementsByName("hover");
var _hovers = new Array();
var info = "ÄúµÄÐËȤ°®ºÃΪ:" ;
for(var i=0;i<hovers.length;i++)
if(hovers[i].checked)
_hovers[i] = hovers[i].value;
for(var t in _hovers)
info += _hovers[t] + "\t";
alert(info);
}
// --></mce:script>
2¡¢Web¿Ø¼þ System.Web.UI.Controls
·þÎñÆ÷¿Ø¼þ£¬Ìṩ·á¸»µÄ¹¦ÄÜ£¬¿ÉÖ´Ðи´ÔÓµÄÒ³ÃæÇëÇó
Web·þÎñÆ÷¿Ø¼þÒÔasp:¿ªÍ·£¬³ÆΪ±ê¼Çǰ׺£¬ºóÃæÊǿؼþÀàÐÍ£¬
ÀýÈç:<asp:Label ID="lblTitle" runat="server"></asp:Label>
ÕâÖÖ±ê×¢·½Ê½¾ÍºÜÇå³þµØÖªµÀ¿Ø¼þµÄ¾ßÌåÀà
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
ÍòÊ¿ªÍ·ÄÑ
ÕÒÁ˺ܶàAPS.NETµÄÊ飬ÒÔ¼°ÌýÀÏʦ½²µÄÖÆ×÷Á÷³Ì£¬»òÕßÔÚMSDNÀïÕÒµ½µÄ×ÊÁÏ£¬
´ó¸ÅÒòΪ±àÒëÆ÷µÄÔÒò£¬¶¼²»Ì«Ïàͬ£¬µ¼ÖÂ×Ô¼º°´×Ų½ÖèÒ²×ö²»¶Ô
½ñÌìÖÕÓÚÖªµÀÕý¹æµÄ×ö·¨ÁË ¹þ¹þ ¸Ï¿ì¼ÇÏÂÁË~
1.File=¡·Îļþ=¡·Ð½¨=¡·ÍøÕ¾=¡·ASP.NETÍøÕ¾
µã»÷È·ÈϾͿÉÒÔÁË
2.¿ªÊ¼Éè¼ÆÒ³Ãæ
Éè¼ÆÈ«²¿ÊÇÔÚDefault.aspxÀïÃæ
Ë ......
2009Äê11ÔÂ23ÈÕ ÐÇÆÚÒ» 10:21
ASP.NET ÌṩÈýÖÖÓÃÓÚÔÚ³öÏÖ´íÎóʱ²¶»ñºÍÏìÓ¦´íÎóµÄÖ÷Òª·½·¨£ºPage_Error ʼþ¡¢Application_Error ʼþÒÔ¼°Ó¦ÓóÌÐòÅäÖÃÎļþ (Web.config)¡£
Èç¹ûÄú²»µ÷Óà Server.ClearError »òÕß²¶»ñ Page_Error »ò Application_Error ʼþÖеĴíÎó£¬Ôò½«¸ù¾Ý Web.config ÎļþµÄ <customErrors> ²¿· ......
LinqDataSource ¿Ø¼þͨ¹ý ASP.NET Êý¾ÝÔ´¿Ø¼þ½á¹¹Ïò Web ¿ª·¢ÈËÔ±¹«¿ªÓïÑÔ¼¯³É²éѯ (LINQ)¡£LINQ ÌṩһÖÖÓÃÓÚÔÚ²»Í¬ÀàÐ͵ÄÊý¾ÝÔ´ÖвéѯºÍ¸üÐÂÊý¾ÝµÄͳһ±à³ÌÄ£ÐÍ£¬²¢½«Êý¾Ý¹¦ÄÜÖ±½ÓÀ©Õ¹µ½ C# ºÍ Visual Basic ÓïÑÔÖС£LINQ ͨ¹ý½«ÃæÏò¶ÔÏó±à³ÌµÄ×¼ÔòÓ¦ÓÃÓÚ¹ØϵÊý¾Ý£¬¼ò»¯ÁËÃæÏò¶ÔÏó±à³ÌÓ ......
1.Á¬½ÓÊý¾Ý¿âÎļþ
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true" />
SqlConnectionStringBuilderʵÀý»¯Ê±£¬ÒªÓõ½connectionString£¬È磺SqlConnectionStringBuild builder = new SqlC ......