Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

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

Thursday, November 3, 2022

Convert to application in website in webapp in IIS server -asp.net and how to revert it back to webapp

 >Open IIS

> Just right click on the folder that is webapp

> Click on convert to webapp

> To revert it back just click on delete, it will be converted into folder

Tuesday, October 25, 2022

How to enable SSL Certificate in IIS Website - https

 https://techexpert.tips/iis/enable-https-iis/


https://onlinehelp.coveo.com/en/ces/7.0/administrator/enabling_ssl_in_iis.htm

Default document in web.config

  <defaultDocument>

      <files>

        <clear/>

                <add value="dgm.aspx"/>

        <add value="dgm.aspx.cs"/>

        <add value="DGM_BMaster_Page.master"/>

        <add value="Default.htm"/>

        <add value="Default.asp"/>

        <add value="index.htm"/>

        <add value="index.html"/>

        <add value="iisstart.htm"/>

      </files>

    </defaultDocument>


> Or Open IIS and click on Default document and Click on add button.

> you can add multiple pages. The page that is on First will redirect first.

Mime Type in web.config or in IIS server

 <staticContent>

      <mimeMap fileExtension=".tab" mimeType="text/plain"/>

    </staticContent>


> Or Open IIS server and click on Mime types and click on add.

> Right click to remove it.

Thursday, October 20, 2022

HTTP Error 401.3 - Unauthorized in asp.net website

 >Open IIS server

> Click on website

> Open feature view

> Double click on Authentication

> Click on 'Anonymous Authentication'

> Click on Edit and apply radio box 'Application Pool Identity'

Thursday, July 14, 2022

How to create and clear cache in ASP.NET C# Or in IIS

 

1. How to clear cache in asp.net C# (clear specified cache)

string cacheKey = "TestCache";

//Add cache
       Cache.Add(cacheKey, "Cache content", null, DateTime.Now.AddMinutes(30), TimeSpan.Zero, CacheItemPriority.High, null);

Cache.Remove(cacheKey);//C# clear cache

 

2. How to clear all caches in asp.net C#

IDictionaryEnumerator allCaches = HttpRuntime.Cache.GetEnumerator();

while (allCaches.MoveNext())
       {
              Cache.Remove(allCaches.Key.ToString());
       }
       Response.Write("Remove all caches!");


OR

>In IIS Goto HTTP Responses

>Click on 'set common headers'

> Click on 'Expire web content' and click OK

reference:- https://mohamedradwan.com/2010/12/26/caching-static-files-js-files-css-and-images-in-iis-7/