ASP.NET2005 ÉèÖÃGridView±íÍ·µÄ±³¾°Í¼Æ¬
×î½üÔÚ×öÒ»¸öÍøÕ¾£¬ÏÔʾÊý¾ÝʱΪÁË·½±ãʹÓÃÁËGridView¡£ËäÈ»GridViewÏÔʾÊý¾ÝµÄ¹¦ÄܺÜÇ¿Ò²ºÜ·½±ã£¬µ«ËüµÄÑùʽȴ²¢²»ÃÀ¹Û¡£ÎªÁËʹGridViewµÄÏÔʾÑùʽÃÀ¹ÛһЩ£¬¾³£ÐèÒªÉèÖñíÍ·µÄ±³¾°£¬ÎÒ×ܽá³öµÄ·½·¨ÈçÏ£º
·½·¨Ò»£º
ÔÚGridViewµÄOnRowDataBoundʼþÖÐÉèÖñ³¾°£¬´úÂëÈçÏ£º
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Attributes.Add("style", "background-image:url('images/title.gif')");
}
}
·½·¨¶þ£º
ºÍÉÏÃæµÄ·½·¨Ò»Ñù£¬Ö»ÊÇ´úÂë²»Ò»Ñù£º
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Style.Add("background-image", "images/title.gif");
}
}
·½·¨Èý£º
ʹÓÃCSS£¬ÉèÖÃGridViewÿһÁеÄHeaderStyleµÄCssClassÏ°ÐÔ£¬´úÂëÈçÏ£º
<style type="text/css">
.headbackground
{
background-image:url(images/title.gif);
}
</style>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="id" HeaderText="񅧏">
<HeaderStyle CssClass="headbackground" />
</asp:BoundField>
<asp:HyperLinkField DataTextField="title" HeaderText="±êÌâ">
<HeaderStyle CssClass="headbackground" />
</asp:HyperLinkField>
</Columns>
</asp:GridView>
Ïà¹ØÎĵµ£º
ASP.NET·ÖÒ³·½·¨µÄÁ˽â³Ì¶È
¡¾³öÏÖƵÂÊ¡¿
¡ï¡ï¡ï¡ï¡î
¡¾½â´ð¡¿
ASP.NET·ÖÒ³µÄ³£Ó÷½·¨ÓÐÒÔϼ¸ÖÖ¡£
q ÆôÓò¿·ÖÊý¾Ý¿Ø¼þµÄÄÚÖ÷ÖÒ³¹¦ÄÜ£¬ÈçÉèÖÃGridView¿Ø¼þµÄ“AllowPaging”ÊôÐÔΪ“true”£¬ÀàËƵÄÊý¾Ý¿Ø¼þ»¹ÓÐDetailsViewµÈ¡£
q ͨ¹ýSQL²éѯÓï¾ä£¬ÒÔÌáÈ¡Ö¸¶¨²¿·ÖµÄÊý¾ÝµÄ·½Ê½Íê³É·ÖÒ³µÄ¹¦ÄÜ¡£Ò ......
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('¼ÓÈëÔÝ´æ¼Ü³É¹¦£¡');</script>");
asp.net¼òµ¥¼ÓÃÜ
//using System.Web.Security;
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfig ......
Ò»¡¢×Ô¶¨Òå FCKeditor µÄ BasePathBasePath ¼´FCKeditorÔÚÍøÕ¾ÖеÄÏà¶Ô·¾¶£¬Ä¬ÈÏÖµÊÇ /fckeditor/£¬×îºÃÔÚWeb.config appSettingsÖжÔÆä½øÐÐÅäÖãº
<add key="FCKeditor:BasePath" value="/FCKeditor_2.6.3/"/>
ÕâÑù×öÓÐÖî¶àÓŵ㣺
1.¿ª·¢»·¾³ÓëÉú²ú»·¾³²»Í¬£¬¿ª·¢»·¾³Ò»°ãÊÇhttp://localhost/xxx.com/ÕâÖÖÇé¿öÏ ......
Asp.netÖÐʵÏÖÒ³ÃæÌøתµÄÈýÖÖ·½·¨±È½Ï£¬ÏÖÔÚ×ܽáÈçÏ£º
1 Response.Redirect
Õâ¸öÌøתҳÃæµÄ·½·¨ÌøתµÄËٶȲ»¿ì£¬ÒòΪËüÒª×ß2¸öÀ´»Ø£¨2´Îpostback£©£¬µ«Ëû¿ÉÒÔÌø תµ½ÈκÎÒ³Ã棬ûÓÐÕ¾µãÒ³ÃæÏÞÖÆ£¨¼´¿ÉÒÔÓÉÑÅ»¢Ìøµ½ÐÂÀË£©£¬Í¬Ê±²»ÄÜÌø¹ýµÇ¼±£»¤¡£µ«ËÙ¶ÈÂýÊÇÆä×î´óȱÏÝ£¡RedirectÌøת»úÖÆ£ºÊ×ÏÈÊÇ·¢ËÍÒ»¸öht ......
1.¶Á³ö·½Ê½
DataReaderºÍDataSet¶¼¿ÉÒÔʵÏÖ¶ÔÊý¾Ý¿âÊý¾ÝµÄ²éѯ·µ»Ø£¬µ«Ç°ÕßÖ»ÄÜÌṩ¿ìËٵIJéѯ·½Ê½£¬ºóÕß»¹¿ÉÒÔʵÏÖ¶ÔÊý¾ÝµÄÌí¼Ó¡¢Ð޸ġ¢É¾³ý¹¦ÄÜ¡£
£¨1£©DataReader·½Ê½¶ÁÈ¡£º
string sConnString = "server=localhost;User Id=root;password=root;Persist Security Info=True;database=db_user";
MySqlConnection myC ......