易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET去掉HTML标记

using System;
using System.Web;
using System.Text.RegularExpressions;
public static string NoHTML(string Htmlstring)  
  {  
   //删除脚本  
   Htmlstring   =   Regex.Replace(Htmlstring,@"<script[^>]*?>.*?</script>","",RegexOptions.IgnoreCase);  
   //删除HTML  
   Htmlstring   =   Regex.Replace(Htmlstring,@"<(.[^>]*)>","",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"([\r\n])[\s]+","",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"-->","",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"<!--.*","",RegexOptions.IgnoreCase);  
   
   Htmlstring   =   Regex.Replace(Htmlstring,@"&(quot|#34);","\"",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"&(amp|#38);","&",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"&(lt|#60);","<",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"&(gt|#62);",">",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"&(nbsp|#160);","   ",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"&(iexcl|#161);","\xa1",RegexOptions.IgnoreCase);  
   Htmlstring   =   Regex.Replace(Htmlstring,@"&(cent|#162);","\xa2",RegexOptions.IgnoreCase);  
   Htmlstring   = &nbs


相关文档:

asp.net实现省市区级联下拉列表并保存状态

asp.net实现省市联动并且保存状态,实现原理:初次使用C#传统的DataBind进行数据绑定,选择省,市后进行ajax方式加载下级列表,并将选定值保存到Hidden中,点击提交后根据Hidden的值进行省,市绑定,再将Hidden的值赋给DropDownList的SelectedValue,从而实现状态的保存。
HTML代码
<asp:HiddenField ID="HiddenField ......

Asp.net中DataBinder.Eval 用法

Asp.net中DataBinder.Eval用法的总结
<%# Bind("Subject") %> //绑定字段
<%# Container.DataItemIndex + 1%> //实现自动编号
<%# DataBinder.Eval(Container.DataItem, "[n]") %>
通常使用的方法(这三个性能最好)
<%# DataBinder.Eval(Container.DataItem, "ColumnName") %>
<%# DataBi ......

asp.net ajax, ASPxCallBack学习

----------------------ModalPopupExtender
D:\sourceforge\asp.net\AjaxControlToolkit_net20\SampleWebSite\ModalPopup\ModalPopup.aspx
// linkbutton1增加扩展ModalPopupExtender属性:
<asp:LinkButton ID="LinkButton1" runat="server" Text="Click here to change the paragraph styl ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号