ASP.NETÖÐGridView·ÖÒ³
·½·¨Ò»:
н¨Ò»¸öÒ³ÃæÈ»ºóÔÚÒ³ÃæÍÏÒ»¸öGridView¿Ø¼þÔÚÊôÐÔ¿òÖÐÉèÖÃGridView¿Ø¼þµÄAllowPaingÊôÐÔΪTrue È»ºóÔÙÉèÖÃGridViewµÄPageSizeÊôÐÔ,Ô´ÎļþÈçÏÂ:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames ="classId" CellPadding="5" OnRowDeleting="GridView1_RowDeleting" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize ="15">
<Columns>
<asp:BoundField DataField ="className" HeaderText ="Ãû³Æ" />
<asp:BoundField DataField="classDes" HeaderText="ÃèÊö" SortExpression="classDes" />
</Columns>
<PagerTemplate>
<table style="font-size :12px;">
<tr>
<td> ×ܹ²<asp:Label ID="Label1" runat="server" Text="<%#((GridView)Container.NamingContainer).PageCount %>"></asp:Label>Ò³ </td>
<td> µÚ<asp:Label ID="Label2" runat="server" Text="<%#((GridView)Container.NamingContainer).PageIndex+1 %>"></asp:Label>Ò³ </td>
&n
Ïà¹ØÎĵµ£º
Data Source=sqlservername;Initial Catalog=dbname;User ID=userid;Password=userpwd
Data Source=(local)\\SQLEXPRESS;Initial Catalog=Êý¾Ý¿âÃû;Integrated Security=True
Data Source=(local);Initial Catalog=Êý¾Ý¿âÃû;User ID=ÕʺÅ;Password=ÕʺÅÃÜÂë
Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\BegASPNET\ ......
Asp.net ÖÐÔÚ¿Í»§¶Ë´¥·¢·þÎñ¶Ëʼþ·ÖΪÁ½ÖÖÇé¿ö£º
Ò». WebControlsÖеÄButton ºÍHtmlControlsÖеÄTypeΪsubmitµÄHtmlInputButton
ÕâÁ½ÖÖ°´Å¥×îÖÕµ½¿Í»§¶ËµÄ±íÏÖÐÎʽΪ£º < input name="Submit1" id="Submit1" type="submit" value=”Submit”>£¬ÕâÊÇForm±íµ¥µÄÌ ......
·½·¨1:
±ÈÈ罨Á¢Ò»¸öÃûΪcnlive£¬ÖµÎª"123"µÄcookie
HttpCookie cookie = new HttpCookie["cnlive"];
cookie.Value = "123";
Response.AppendCookie(cookie);
È¡¸Õ²ÅдÈëµÄCookieÖµ:
HttpCookie cookie = Request.Cookies["cnlive"];
cookieValue = cookie.Value;
ÔÚÒ»¸öCookieÖд¢´æ¶à¸öÐÅÏ¢:
HttpCookie cookie ......
1.µ¯³ö¶Ô»°¿ò.
a. µ¯³ö¶Ô»°¿ò£º
C# codeClientScript.RegisterStartupScript(this.GetType(), "",
"<script>window.alert('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡')</script>");
b.תÏòÖ¸¶¨Ò³Ãæ
C# code Response.Write("
<script>window.location='http://www. ......