• How to read web page contents in ASP.NET

    by  • May 19, 2013 • Microsoft .NET C# (C-Sharp), Microsoft ASP.NET • 0 Comments

    Different browsers provide facility to read web page contents but sometimes we need to read web page content in our ASP.NET application. ASP.NET has some built-in classes that we can use to read web page contents. There are also many libraries like HtmlAgilityPack to achieve this but ASP.NET built-in classes provide simple and easy ways.

    WebClient class has DownloadSting() function that gives us web page content in one line of code.

    WebClient class has also DownloadData() function which gives us web page content in byte array.

    Some people think that above approach is not a better one so we can use another approach to read web page contents. In this approach, HttpWebRequest and HttpWebResposnce classes can be used to get contents of web pages.

    Best WordPress Themes and Plugins with Great Team and Support!

    Avatar of GetCodeSnippet.com


    GetCodeSnippet.com provides you high quality Microsoft .NET development related articles, tutorials and sample code for ASP.NET, C#, VB.NET, AJAX, WCF, WPF, Web Services, Windows Services, SQL Server and other technologies.

    Leave a Reply