aspx不显示ViewState的实例
2013-03-29 00:00
495 查看
System.IO.StringWriter html = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter tw = new System.Web.UI.HtmlTextWriter(html); base.Render(tw); string Temp = html.ToString(); string s1 = string.Empty, s2 = string.Empty, s3 = string.Empty, s4 = string.Empty, s5 = string.Empty, s6 = string.Empty; int i = 0; int j = 0; i = Temp.IndexOf("<form"); if (i > 0) { j = Temp.IndexOf(">", i); s1 = Temp.Substring(0, i); s2 = Temp.Substring(j + 1, Temp.Length - j - 1); } i = s2.IndexOf("<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\""); if (i > 0) { j = s2.IndexOf(">", i); s3 = s2.Substring(0, i); s4 = s2.Substring(j + 1, s2.Length - j - 1); } i = s4.IndexOf("<input type=\"hidden\" name=\"__EVENTVALIDATION\" id=\"__EVENTVALIDATION\""); if (i > 0) { j = s4.IndexOf(">", i); s5 = s4.Substring(0, i); s6 = s4.Substring(j + 1, s4.Length - j - 1); Temp = s1 + s3 + s5 + s6; } else { Temp = s1 + s3 + s4; } Temp = Temp.Replace("</form>", ""); Temp = Temp.Replace("\r\n", ""); tw.Close(); Response.Write(Temp);
相关文章推荐
- aspx不显示ViewState的实例
- android读取Assets图片资源保存到SD卡然后显示到ImageView里 实例
- ASP.NET Internals: Viewstate and Page Life Cycle(http://www.codeproject.com/KB/aspnet/aspnetviewstatepagecycle.aspx)
- android viewpager 拿到当前显示的 fragment 的实例
- 【转】怎么让开发的aspx返回的页面网页源文件中没有“乱码”ViewState???
- 对象序列化(七):应用实例->asp.net ViewState
- aspx 页面中 EnableViewState="false" 的效果
- pyton简单网络爬虫,aspx网站中form使用到了__VIEWSTATE、__EVENTVALIDATION、cookie来验证的提交
- UITableView 系列三 :分类显示和改变外观 (实例)
- ASP.NET ViewState 解析与实例
- aspx页面里不输出 nput type=hidden name="__VIEWSTATE" 的方法
- iOS开发上下滑动UIScrollview隐藏或者显示导航栏的实例
- 转储ViewState-为Aspx减肥(一)
- ViewState 视图状态对象实例
- ios开发加载webview显示进度条实例
- UITableView 系列一 :基本使用方法 (显示,删除,添加图片,添加样式等) (实例)
- 自定义View之MultiStateView根据不同状态显示不同布局的View(雷惊风)
- MultiStateView不同的状态下显示不同的界面
- Viewstate--在.aspx中自动储存~非input元素~的值,不需要的要禁止
- aspx、ashx以及cs的关系,viewState