Friday, May 3, 2013

How to extract text from html by HtmlAgilityPack?

            string htmlstring ="


"; HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(htmlstring); foreach (var script in doc.DocumentNode.Descendants("script").ToArray()) script.Remove(); foreach (var style in doc.DocumentNode.Descendants("style").ToArray()) style.Remove(); string ExtractedText = doc.DocumentNode.InnerText;

How to change EDMX connection string at runtime in Entity Framework?

Call constructor with connection string parameter like:
var db = new dbContext(connectionstring);

How to use MVC, Webforms and Web API in same ASP.NET project?

Leverage Multiple Code Frameworks with One ASP.NE

Remove Unwanted HTTP Response Headers

Server - Specifies web server version.
X-Powered-By - Indicates that the website is "powered by ASP.NET."
X-AspNet-Version - Specifies the version of ASP.NET used.