Friday, February 28, 2014

How to remove html tag in description?

 public static string RemoveHTMLTags(string content)
    {
        var cleaned = string.Empty;
        try
        {
            StringBuilder textOnly = new StringBuilder();
            using (var reader = XmlNodeReader.Create(new System.IO.StringReader("<xml>" + content + "</xml>")))
            {
                while (reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.Text)
                        textOnly.Append(reader.ReadContentAsString());
                }
            }
            cleaned = textOnly.ToString();
        }
        catch
        {
            //A tag is probably not closed. fallback to regex string clean.
            string textOnly = string.Empty;
            Regex tagRemove = new Regex(@"<[^>]*(>|$)");
            Regex compressSpaces = new Regex(@"[\s\r\n]+");
            textOnly = tagRemove.Replace(content, string.Empty);
            textOnly = compressSpaces.Replace(textOnly, " ");
            cleaned = textOnly;
        }

        return cleaned;
    }

Thursday, February 6, 2014

First DNN Setting in Web.config.



<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="100000000" />
</requestFiltering>
</security>
</system.webServer>



Change connection string:

<add name="SiteSqlServer" connectionString="Data Source= Abhishek-pc\sql2008;Initial Catalog=dnnT; uid=sa; password=2008;" providerName="System.Data.SqlClient" />


and also  if u don't want to by wizard then set to false

<add key="UseInstallWizard" value="false" />

First set the all permission on project folder and deploy In IIS