摘要:
public DataTable GetPagedTable(DataTable dt, int PageIndex, int PageSize) { if (PageIndex == 0) { return dt; } DataTable newdt = dt.Copy(); newdt.Clear(); int rowbegin = (PageIndex - 1) * PageSize; int rowend = PageIndex * PageSize; if (rowbegin >= dt.Rows.Count) { return newdt; } if (rowend > 阅读全文
摘要:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="grid" AllowPaging="True" DataKeyNames="orderNO" PageSize="5" onpageindexchanged="GridView1_PageIndexChanged" onpageindexchanging=" 阅读全文
摘要:
重写Page类中的LoadPageStateFromPersistenceMedium()和SavePageStateToPersistenceMedium(object state)方法。Demo:将ViewState存放到Session中:protected LosFormatter losFormatter;protected override object LoadPageStateFromPersistenceMedium(){ string key = Request.RawUrl + "__viewstate"; if (Session[key] != nul 阅读全文
摘要:
//方法一 HttpContext.Current.Request.UserHostAddress;//方法二 HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];//方法三 string strHostName = System.Net.Dns.GetHostName(); string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();//方法四(无视代理) HttpContext.C 阅读全文
摘要:
目录(一).概述... (二).应用场景代码示例... 1).ScriptManager控件示例... 1. 在异步调用服务端注册客户端脚本新方法... 2. 捕获Ajax异步调用中错误(默认使用alert提示). 3. 捕获Ajax异步调用中错误(自定义输出错误方式) 2).UpdatePanel控件示例... 4. RenderMode属性用法示例... 5. UpdateMode用法示例... 6. ChildrenAsTriggers属性用法示例... 7. Triggers属性用法示例... 3). UpdateProgress控件示例... 8. 在异步更新时显示滚... 阅读全文