Nhiều web.sitemap trong web site

1. Cấu hình web.config

<siteMap defaultProvider=”AspNetXmlSiteMapProvider” enabled=”true”>
<providers>
<add name=”AdminSiteMapProvider”
description=”The site map provider that reads in the Admin.sitemap XML files.”
type=”System.Web.XmlSiteMapProvider”
siteMapFile=”~/MasterPages/Web.Sitemap”/>
</providers>
</siteMap>

2. Chỉ ra sitemapProvider trong SiteMapDataSource

<asp:SiteMapDataSource ID=”SiteMapDataSource1″ ShowStartingNode=”false” runat=”server” SiteMapProvider=”AdminSiteMapProvider” />

Remove HTML tags

public static string StripHtml(string html, bool allowHarmlessTags)
{
if (html == null || html == string.Empty)
return string.Empty; 

if (allowHarmlessTags)
return System.Text.RegularExpressions.Regex.Replace(html, “”, string.Empty);

return System.Text.RegularExpressions.Regex.Replace(html, “<[^>]*>”, string.Empty);
}

You want to remove HTML tags from your string.

1
2
3
4
string html = "remover <b>html</b> tages " +
     "from <i>string</i> asp.net c#";
string newString = Regex.Replace(html , "<.*?>", string.Empty);

in gridview or datalist bind

?
1
<%#  Regex.Replace(Eval("ItemDetail").ToString(), "<.*?>", string.Empty)%>