Friday, May 3, 2013

How to extract text from html by HtmlAgilityPack?


            string htmlstring ="

adsasd

"; 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?

http://msdn.microsoft.com/en-us/magazine/dn198242.aspx


Leverage Multiple Code Frameworks with One ASP.NE

Remove Unwanted HTTP Response Headers

http://blogs.msdn.com/b/varunm/archive/2013/04/23/remove-unwanted-http-response-headers.aspx

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.

Thursday, May 2, 2013

How to change cursor when loading page or selecting item from dropdownlist in ASP.NET webform?

Goto master page
Add two events in body tag like following
<body onbeforeunload="document.body.style.cursor = 'wait';" onunload="document.body.style.cursor = 'default';">