ASP.NETÖÐÁ¬½ÓÊý¾Ý¿âµÄ¸÷ÖÖ·½·¨
½ñÌ죬ѧϰÁËASP.NETÖÐÁ¬½ÓÊý¾Ý¿âµÄ¸÷ÖÖ·½·¨£¬ÕâÊÇÎÒ×Ô¼ºµÄÒ»¸öС×ܽᣬ²»Ò»¶¨ÍêÈ«ÕýÈ·£¬½ö¹©²Î¿¼£¡ O(∩_∩)O~
Á¬½ÓSQLÊý¾Ý¿âµÄ·½·¨£º
(Ò»)¡¢ÔÚWeb.ConfigÖд´½¨Á¬½Ó×Ö·û´®£º
1¡¢
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\grade.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
2¡¢
<add name="sampleConnectionString" connectionString ="server=.\SQLEXPRESS;database=sample;uid=sa;pwd=123456;" providerName ="System.Data.SqlClient"/>
3¡¢
<add name ="testConnectionString" connectionString ="Data Source=.\SQLEXPRESS;Initial Catalog=sample;Integrated Security=True;Persist Security Info=True;User ID=sa;Password=123456" providerName ="System.Data.SqlClient"/>
(¶þ)¡¢ÔÚaspx.csÖлñÈ¡Á¬½Ó×Ö·û´®£º
1¡¢
string strCon = System.Configuration.ConfigurationManager.ConnectionStrings["sampleConnectionString"].ConnectionString;
2¡¢
string strCon = System.Configuration.ConfigurationManager.ConnectionStrings["sampleConnectionString"].ToString();
3¡¢
string strCon = System.Configuration.ConfigurationManager.ConnectionStrings["testConnectionString"].ToString();
(Èý)¡¢½«Á¬½Ó×Ö·û´®Ö±½Óдµ½Ò³ÃæÀï
1¡¢
string strCon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\grade.mdf;Integrated Security=True;User Instance=True";
2¡¢
string strCon = "Data Source=.\\SQLEXPRESS;Initial Catalog=sample;Integrated Security=True;Persist Security Info=True;User ID=sa;Password=123456";
3¡¢
string strCon = "server=.\\SQLEXPRESS;database=sample;uid=sa;pwd=123456";
Á¬½ÓAccessÊý¾Ý¿â(yx.mdb)µÄ·½·¨£º
(Ò»)¡¢ÔÚWeb.ConfigÖд´½¨Á¬½Ó×Ö·û´®£º
<add name ="accessConnectionString" connectionString ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\yx.mdb" providerName ="System.Data.OleDb"/>
(¶þ)¡¢ÔÚaspx.csÖлñÈ¡Á¬½Ó×Ö·û´®£º
1¡¢
string strCon = System.Configuration.ConfigurationManager.ConnectionStrings["accessConnectionString"].ToSt
Ïà¹ØÎĵµ£º
ÔÚasp.net 1.1ÖÐ, ¶þ¼¶ÓòÃûFormsÑé֤ģʽϹ²ÏíµÇ½״̬µÄ·½·¨Çë²Î¿¼ÏÂÃæÎÄÕÂ:
http://www.cnblogs.com/caomao/archive/2005/07/05/186606.html
¶øÔÚasp.net 2.0ÖÐʵÏÖ·½·¨¸üΪ¼òµ¥£¬Ö»ÐèÐÞ¸Äweb.configÎļþ¼´¿É£¬Ð޸ķ½·¨ÈçÏÂ:
<authentication mode="Forms">
<forms name ......
RepeaterÔÚǰ̨ʹÓñȽÏÁé»î×ÔÓÉ£¬µ«ÓÐÒ»¸öÎÊÌâ¾ÍÊÇRepeater²»Ö§³ÖÖ±½Ó·ÖÒ³£¬Õâ¸öºÜ¶àÈË¿´ÆðÀ´¾ÍÓе㲻ÏëÓÃÁË£¬µ«ÎÒÏë´ó¼Ò¶¼ÖªµÀGridView¿Ø¼þ»òDataGrid¿Ø¼þÔÚÆôÓÃ×Ô´ø·ÖÒ³µÄʱºòÆäʵЧÂÊÊǷdz£µÍµÄ£¬´óµÄ²»Ëµ£¬Ò»µ«µ½ÁË°ÙÍò¼¶Êý¾ÝÒԺ󣬾ͻá¸Ð¾õÊǶàôµÄÍ´¿àºÍÎÞÄÍÁË£¬ËùÒÔ¼´Ê¹ÊÇÓÃDataGrid(GridView)¿Ø¼þ£¬¸ßÊÖÃÇ»¹ÊÇÖ»»á ......
ͨ³£javascript´úÂë¿ÉÒÔÓëHTML±êÇ©Ò»ÆðÖ±½Ó·ÅÔÚÇ°¶ËÒ³ÃæÖУ¬µ«Èç¹ûJS´úÂë¶àµÄ»°Ò»·½Ãæ²»ÀûÓÚά»¤£¬ÁíÒ»·½ÃæÒ²¶ÔËÑË÷ÒýÇæ²»ÓѺã¬Òò
ΪҳÃæÒò´Ë¶ø±äµÃÓ·Ö×£»ËùÒÔÒ»°ãÓÐÁ¼ºÃ¿ª·¢Ï°¹ßµÄ³ÌÐòÔ±¶¼»á°Ñjavascript´úÂë·Åµ½¶ÀÁ¢µÄjsÎļþÖУ¬ÆäËûÒ³Ãæͨ¹ýÒýÈë¸ÃjsÎļþÀ´Ê¹ÓÃÏàÓ¦µÄ
javascript´úÂë¡£
½ñÌìÔÚ×öÒ»¸öСÐÂÎÅϵͳµÄ¹ÜÀí ......
1>>δÄܼÓÔØÎļþ»ò³ÌÐò¼¯“System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35”»òËüµÄijһ¸öÒÀÀµÏϵͳÕÒ²»µ½Ö¸¶¨µÄÎļþ¡£
½â¾ö£ºµ½C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 1.0\Assemblies ÏÂÕÒµ½ System.Web.Mvc.dll Îļþ ¸´ÖƵ½ÏîÄ¿µÄbinÄ¿Â¼Ï ......
Õâ¸öÎÊÌâÀ§ÈÅÁËÎÒÁ½Ì죬ÊÖ»úÏÂÔØ
protected void Page_Load(object sender, EventArgs e)
{
string filename = Server.UrlDecode(Request["upload"]);
string filePath = Server.MapPath("uploa ......