ASP.NETÖ´Ðд洢¹ý³Ì£¬²¢»ñÈ¡´æ´¢¹ý³ÌµÄ·µ»ØÖµ
//Á¬½ÓÊý¾Ý¿â
string myStr = CODE.DbHelperSQL.connectionString;
SqlConnection myConn = new SqlConnection(myStr);
myConn.Open();
//´´½¨SqlCommand¶ÔÏó
SqlCommand cmd = new SqlCommand("pr_GetSQLWhere", myConn);
cmd.CommandType = CommandType.StoredProcedure;
//Ìí¼Ó²ÎÊý
SqlParameter sUserID = cmd.Parameters.Add("@sUserID", SqlDbType.VarChar,50);
sUserID.Value ="01";
SqlParameter sRetSQL = cmd.Parameters.Add("@sRetSQL", SqlDbType.VarChar,50);
sRetSQL.Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
string strs = sRetSQL.Value.ToString();
return strs;
Ïà¹ØÎĵµ£º
ÔÚÔçÆÚѧϰc#µÄ¹ý³ÌÖУ¬¾³£Óöµ½ÕâÑùµÄÓï¾ä£º
public string StudentName
{
get{return stuName;}
set{stuName=value;}
}
µ±Ê±Ò²²»ÊǺÜÃ÷°×ΪʲôҪÕâÑù£¿Ñ§ÉîÁËc#ºó£ ......
Form ±íµ¥£ºÒ»¸öÒ³ÃæÖ»ÄÜÓÐÒ»¸ö
runat=“server”²»ÊDZØÐëµÄ£¬¼ÓÉϺ󣬻áÔÚÊä³öµÄÔ´´úÂëÀï¶àÁËÒ»ÐÐ
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGR/8ZxOm5Tn0sfHNJaqE12hKqqJTQ==" />
ºÙ£¬Õâ²»¾ÍÊÇ´«ËµÖеÄviewstateÂð¡£ÔÀ´Õâ¾ÍÊÇ.netÖеÄFORM¸úHTMLÖÐF ......
1¡¢ response.redirect Õâ¸öÌø×ªÒ³ÃæµÄ·½·¨Ìø×ªµÄËٶȲ»¿ì£¬ÒòΪËüÒª×ß2¸öÀ´»Ø(2´Îpostback)£¬µ«Ëû¿ÉÒÔÌø תµ½ÈκÎÒ³Ãæ£¬Ã»ÓÐÕ¾µãÒ³ÃæÏÞÖÆ(¼´¿ÉÒÔÓÉÑÅ»¢Ìøµ½ÐÂÀË)£¬Í¬Ê±²»ÄÜÌø¹ýµÇ¼±£»¤¡£µ«ËÙ¶ÈÂýÊÇÆä×î´óȱÏÝ!redirectÌø×ª»úÖÆ£ºÊ×ÏÈÊÇ·¢ËÍÒ»¸öhttpÇëÇ󵽿ͻ§¶Ë£¬Í¨ÖªÐèÒªÌø×ªµ½ÐÂÒ³Ãæ£¬È»ºó¿Í»§¶ËÔÚ·¢ËÍÌø×ªÇëÇóµ½·þÎñÆ÷ ......
´Ë´¦ÌṩµÄ´úÂëÓÃÀ´ÊµÏÖµ±asp.netÒ³ÃæÖеÄij¸öButton±»µã»÷ºódisableµô¸ÃÒ³ÃæÖÐËùÓеÄButton£¬´Ó¶ø·ÀÖ¹Ìá½»ÑÓʱµ¼ÖµĶà´ÎÌá½»¡£»ùÓÚ֮ǰµÄonceclickbutton½Å±¾.
//ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂë:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElem ......