asp.netµÄpostback»úÖÆ£º__doPostBack
__doPostBack
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
function __doPostBack(eventTarget, eventArgument)
{
if (!theForm.onsubmit || (theForm.onsubmit() != false))
{
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
ÒòΪ×îÖÕ³ÊÏÖ¸øä¯ÀÀÆ÷µÄÄÚÈݶ¼ÊÇhtmlÄÚÈÝ,²ÉÓÃasp.net¼¼ÊõÒ²²»ÄÜÀýÍâ.ҪʵÏÖwebcontrolµÄpostback»úÖÆ.Ö»ÄÜÔÚÔÀ´µÄsubmitÉÏ×öÎÄÕÂ.ms³ÊÏÖ¸øÎÒÃǵÄ,¾ÍÊÇÕâÖÖ¾«ÇɵÄ˼ά!
ÎÒ¿´µ½,asp.netÏÖÔÚÒ³ÃæÉÏÌí¼ÓÁËÁ½¸öhidden input,ÕâÁ½¸öinput·Ö±ðÓÃÀ´´æ·Å´¥·¢postbackµÄcontrolµÄIDºÍ²ÎÊý.Õâ¾ÍÊÇÎÒÃǴ󲿷ÖÈËÈÏʶµ½µÄ:
__doPostBack(obj1,obj2)µÄµÚÒ»¸ö²ÎÊýÊǿؼþID,µÚ¶þ¸ö²ÎÊýÊÇpostbackµÄ²ÎÊý.È»ºó¾Í¿ÉÒÔÔÚºǫ́ÓÃRequest.Form["__EVENTTARGET"]ºÍRequest.Form["__EVENTARGUMENT"]È¡µÃ¿Ø¼þIDºÍ²ÎÊý.
ºÜ¼òµ¥¾ÍʵÏÖÁË¿´ËƺÜÉñÆæ,ÒÔΪÄÚ²¿ÓÐʲô¸ßÉîµÄ´¦ÀíµÄ¹ý³Ì!Èç´ËÇáÇɵÄʵÏÖÁËasp.netµÄpostback»úÖÆ,Åå·þÅå·þ!Ö»ÒªÎÒÃÇ¿´¶®ÁËÉϱߵĴúÂë,¶Ô__doPostBackµÄʹÓþÍÓ¦¸Ã²»ÊÇʲôÄÑÊÂÁË.¿ÉÒÔ˵__doPostBack¾ÍÊÇÕâô¼òµ¥µÄÒ»»ØÊÂ.
²»¹ý,ÁíÍâҪעÒâµÄ¾ÍÊÇasp.netµÄwebcontrolsÖÐ,ButtonºÍImgButtonÊÇÒìÀà,ËüÃDz»ÊÇÀûÓÃ__doPostBackÀ´ÊµÏÖpostbackµÄ.ΪʲôÕâÑù,¿ÉÄÜÒòΪButtonÔÚhtmlÖб¾À´¾ÍÊÇÓд¥·¢submitʼþµÄ¹¦ÄÜ°É.asp.net²»¹ýÊÇÒªÁîÔÀ´htmlÖÐһЩ²»ÄÜ´¥·¢submitµÄ¶«Î÷submit,²ÅŪ³öÁË__doPostBackÀ´ÊµÏÖ.¶ÔÓÚÔÀ´¾ÍÄÜsubmitµÄButton,Óֺαضà´ËÒ»¾ÙÄØ.(½ö¸öÈËÀí½â,δ¾ÑéÖ¤!)
ËùÒÔÈç¹ûÊÇButtonµÄpostback,ÔÚºǫ́ÊDz»ÄÜÓÃRequest.Form["__EVENTTARGET"]ºÍRequest.Form["__EVENTARGUMENT"]È¡µÃ¿Ø¼þIDºÍ²ÎÊýµÄ.ÄÇô,ÔõôȡÄØ?¿´´úÂë:
È¡Button
foreach (string str in Request.Form)
{
Control c = Page.FindControl(str);
if
Ïà¹ØÎĵµ£º
ÔÚASP.NetÒ»°ãµÄ³ÌÐò±àдÖУ¬ËùʹÓõÄÊý¾ÝÀïÃ棬ÈÕÆÚʱ¼äÊÇÒ»ÖÖÌØÊâµÄÊý¾ÝÀàÐÍ£¬Ò²ÊǾ³£±»Ê¹Óõġ£---µçÄԽ̳̼¼ÊõѧϰÍø
ÔÚVisual Basic.NETÖеÄÈÕÆÚʱ¼äÊý¾ÝÓÃÊýÖµµÄÊý¾ÝÀàÐͱ£´æ£¬¶øÇÒÓз¶Î§¡£
ÈÕÆڵķ¶Î§Êǹ«Ôª1Äê1ÔÂ1ÈÕ¡«¹«Ôª9999Äê1 2ÔÂ3 1ÈÕ£¬Ê±¼äµÄ·¶Î§ÊÇ00£º00£º00¡«23£º59£º59¡£ÉùÃ÷¸ñÊ½È ......
protected void Page_Load(object sender, EventArgs e)
{
/*
sql½Å±¾-´´½¨Ñ§Éú±í
create table student(id int,name varchar(50))
......
×î½üÔÚ×öÒ»¸öÍøÕ¾£¬ÏÔʾÊý¾ÝʱΪÁË·½±ãʹÓÃÁËGridView¡£ËäÈ»GridViewÏÔʾÊý¾ÝµÄ¹¦ÄܺÜÇ¿Ò²ºÜ·½±ã£¬µ«ËüµÄÑùʽȴ²¢²»ÃÀ¹Û¡£ÎªÁËʹGridViewµÄÏÔʾÑùʽÃÀ¹ÛһЩ£¬¾³£ÐèÒªÉèÖñíÍ·µÄ±³¾°£¬ÎÒ×ܽá³öµÄ·½·¨ÈçÏ£º
·½·¨Ò»£º
ÔÚGridViewµÄOnRowDataBoundʼþÖÐÉèÖñ³¾°£¬´úÂëÈçÏ£º
protected void GridView1_RowDataBound(ob ......
µ¼¶Á£º
¡¡¡¡FCKEditorÄ¿Ç°µÄ×îа汾ÊÇ2.6£¬µ«Ö§³Ö.NETµÄDLL°æ±¾»¹ÊÇ2.5£¬±¾ÎĽéÉÜFCKEditor2.6ÔÚASP.NETÖеÄÅäÖ÷½·¨¡£
¡¡¡¡±¾ÎĵÄʾÀýÏÂÔصØÖ·(°üº¬ÁËÕû¸ö½â¾ö·½°¸¼°ÍøÕ¾£¬ÏÂÔغ󼴿ÉʹÓÃ)£º
¡¡¡¡µØÖ·£ºhttp://www.china-aspx.com/Forum/showtopic-57.aspx
¡¡¡¡FCKEditor¹Ù·½ÏÂÔصØÖ·£ºhttp://www.fckeditor.net/down ......
1. Êý¾Ý¿âµÄ²¿Êð
£¨1£©Èí¼þµÄ°²×°
A. MySql——±ØÐë°²×°ÔÚCÅÌÏ£¬·ñÔò°²×°mysql-connector-net-6.2.2ºóÎÞÕýÈ·ÅäÖÃ
B. mysql-connector-net-6.2.2——½«MySql.Data.dll·ÅÔÚBinÎļþ¼ÐÏÂ
£¨2£©Êý¾Ý¿âµÄµ¼³öµ¼Èë
MySQL-FrontµÄ"Áí´æΪ"¹¦ÄÜ¿ÉÒÔ½«Êý¾Ý¿âµ¼³öΪ.sqlÎļþ£¬È»ºóÔÙͨ¹ýËüÖ±½Óµ¼Èë.sqlÎļþ¿ ......