Monday 13 June 2016

Deploy Website In IIS (Asp.net)


Deploy Asp.net Website In IIS Local


1.keep your project  in a folder (eg. D://MyProj/Proj1)
2.go to run
3.type inetmgr
4.on server(LEFT SIDE PANEL)  go to sites>default websites
5.right click on default website and add application
6.give any alias(name for ur project)
7.asp.net application poll must be .net framework 4.0
8.in physical path enter path where your project reside.(eg. D://MyProj/Proj1)

9.'default document' is used to set start_page in case user do not provide any page in url (eg. index.html/defalt.aspx)
10.now go on ur website showing in IIS,right click,manage site and browse.

Below are the solutions for few error which often comes out.


1)HTTP Error 403.14 - Forbidden - The Web server is configured to not list the contents of this directory

DO 1: Enable the Directory Browsing feature in IIS (Recommended)
1.    Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
2.    In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
3.    In the Features view, double-click Directory Browsing.
4.    In the Actions pane, click Enable.
If that does not work for, you might be having different problem than just a Directory listing issue. So follow the below step,

ELSE DO 2: Add a default document
To resolve this problem, follow these steps:
•         Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
•         In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
•         In the Features view, double-click Default Document.
•         In the Actions pane, click Enable.
•         In the File Name box, type the name of the default document, and then click OK.

ELSE DO 3: Enable the Directory Browsing feature in IIS Express

Note This method is for the web developers who experience the issue when they use IIS Express.
Follow these steps:
•         Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt: C:\Program Files\IIS Express
•         Type the following command, and then press Enter:
appcmd set config /section:directoryBrowse /enabled:true


2)ASP.Net IIS7: The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
CD C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -i


Run above command in cmd (RUN AS ADMINISTRATOR)
which will activate asp.net 4.0 like below





3)Website not accessible from other computer in network





1. Open Windows Firewall with Advanced Security ( or run wf.msc)
2. Open Inbound Rules and find World Wide Web Services (HTTP Traffic-In)
3. Right Click on World Wide Web Services (HTTP Traffic-In) and Enable Rule

Print Only Grid View in ASP.net

ASP.net How to Print Only GridView < div id ="gridviewDiv" >   < asp:GridView ID ="gridViewToPri...