RDLC : Web.config Settings for ReportViewer

We, .Net Developers always do many kind of reports using RDLC . But while developing , we get the below error If we do not add web.config entries correctly .

We may get runtime error like below :::

The Report Viewer Web Control HTTP Handler has not been registered in the application’s web.config file

add name=”ReportViewerWebControlHandler” preCondition=”integratedMode” verb=”*” path=”Reserved.ReportViewerWebControl.axd” type=”Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”

To resolve this issue , add these below Nodes to Web.Config.

      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />



      <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler,   Microsoft.ReportViewer.WebForms, Version=,   Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"  />

Cheers 🙂


Get connection String from Web.config in ASP.Net and C#

“Human Brain is amazing , When I don’t want to save something inside my Brain , It also does not want to save it and literally it does not do that. ” – This line is true for me 🙂

And I always go to my previous written Code + Config file (Or Web) to know how to get Connection String from Web.config . I don’t want to use my Processor of the Brain a minimal percentage for this , And I guess , There are also so many people out there in the world , so this Post is for you guys 🙂

So in my Web.config/App.config file , I will add the below thing .

    <add name="connectionStr" connectionString="Data Source=MASOOM-PC;Initial Catalog=ProjectManagerDB;Integrated Security=True" providerName="System.Data.SqlClient" />

And Below is the C# code for that .

string connectionString = ConfigurationManager.ConnectionStrings["connectionStr"].ConnectionString;

We can also add Node to AppSettings in Web.config and can get it easily .

    <add key="EmailTo" value="emailid@yahoo.com" />

And this is how we can get this in C#

string emailTo = ConfigurationSettings.AppSettings["EmailTo"];

In future , I will definitely come to my own Blog for this 🙂 Cheers