Monday, January 23, 2023

localhost site is not running in IIS Server ASP.NET C#

 First solution 

1) Right click on the Website folder in windows explorer or in IIS server

2) Go to security tab  > Click on edit > click on add> Click on advance> Click on find now button> Click on IIS_IUSRS> Clik on ok and than again on ok and grant all the permissions

Second solution

if you find below error

HTTP Error 401.3 - Unauthorized

You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server

1) Open to IIS server

2) Double click on Authentication

3) Click on anonymous authentication> Click on edit and select radio button "application pool identity"


Third solution


> Go to control panel
>Click on turn windows feature on or off
> Click on internet information services(Expand it )
>Click on world wide web services
> Install all the feature cgi, asp etc

Sunday, January 22, 2023

HTTP Handler in ASP.NET C# - How to call a http handler

string handlerUrl = String.Format(Request.Url.Scheme+"://" +Request.Url.Authority+"{0}","/Handler.ashx");

        string response = (new WebClient()).DownloadString(handlerUrl);

and we can pass parameters to processrequest function

 context.Response.ContentType = "application/x-javascript";

        MethodName = context.Request.Params["method"];

        Parameter = context.Request.Params["param"];

        CallBackMethodName = context.Request.Params["callbackmethod"];


 https://www.c-sharpcorner.com/uploadfile/37db1d/create-your-first-http-handler-in-Asp-Net-3-5/

https://www.msdotnet.co.in/2013/10/how-to-create-http-handler-application.html#.Y8zNn3ZByxU

https://www.c-sharpcorner.com/UploadFile/ca2535/call-generic-handler-using-jquery-in-Asp-Net/

https://www.c-sharpcorner.com/article/http-handlers-in-Asp-Net/

How to call ajax jquery call in every one seconds javascript - d3.timer function

 https://www.codespeedy.com/call-jquery-ajax-in-every-n-seconds/


https://makitweb.com/how-to-fire-ajax-request-on-regular-interval/


https://www.codespeedy.com/call-jquery-ajax-in-every-n-seconds/


https://stackoverflow.com/questions/5687600/jquery-call-ajax-every-10-seconds


https://stackoverflow.com/questions/2170923/whats-the-easiest-way-to-call-a-function-every-5-seconds-in-jquery


https://www.javatpoint.com/timer-api-in-d3-js

How to get data from API data.gov.in

 https://api.data.gov.in/resource/0568dfb3-44cd-4bab-a826-06c914a7c3e2?api-key=579b464db66ec23bdd000001cdd3946e44ce4aad7209ff7b23ac571b&format=xml


go to this site and you will get many apis

https://data.gov.in/apis



https://api.data.gov.in/resource/3b01bcb8-0b14-4abf-b6f2-c1bfd384ba69?api-key=579b464db66ec23bdd000001cdd3946e44ce4aad7209ff7b23ac571b&format=xml&filters%5Bcountry%5D=India&filters%5Bstate%5D=haryana