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
Ïà¹ØÎĵµ£º
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 ......
Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" & ......
¡¡Ö´Ðе±Ç° Web ÇëÇóÆÚ¼ä£¬³öÏÖδ´¦ÀíµÄÒì³£¡£Çë¼ì²é¶ÑÕ»¸ú×ÙÐÅÏ¢£¬ÒÔÁ˽âÓйظôíÎóÒÔ¼°´úÂëÖе¼Ö´íÎóµÄ³ö´¦µÄÏêϸÐÅÏ¢¡£
¡¡¡¡Òì³£ÏêϸÐÅÏ¢: System.Data.SqlClient.SqlException: Óû§ 'XXXASPNET' µÇ¼ʧ°Ü¡£
¡¡¡¡½ñÌì½«ÍøÕ¾Ç¨ÒÆ¹ýÀ´ºó,¾Í·¢ÏÖÕâ¸öÎÊÌâ.¾¹ýÃþË÷,·¢ÏÖÔÒòÊÇÎÒÃǵǼÊý¾Ý¿âµÄ½ÇÉ«¶ÔÊý¾Ý¿âµÄȨÏÞ²»¹». ......
¿Í»§¶Ë´«ËÍÊý¾Ýµ½·þÎñÆ÷¶ËÓÐÈýÖÖ·½·¨£º
1.form
2.querystring
3.cookie
ÀûÓÃÕâЩ·½Ê½È¡µÃµÄÊý¾ÝÔÚ·þÎñÆ÷¶Ë¶¼ÊÇ×ֵ伯ºÏ,Èç¹ûÒª¾«È·È¡µ½Ä³¸ö¼¯ºÏµÄÖµ£¬ÔòÖ±½ÓʹÓöÔÓ¦µÄ¼¯ºÏµÄÃû³Æ£¬ÈýÖÖ·½Ê½¶ÔÓ¦µÄ¼¯ºÏÈçÏ£º
1.form:request.form
2.querystring:request.querystring
3.cookie:request.cookie
ÀûÓÃrequest.p ......