Web.Config Part 3
description
Transcript of Web.Config Part 3
![Page 1: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/1.jpg)
![Page 2: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/2.jpg)
![Page 3: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/3.jpg)
![Page 4: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/4.jpg)
![Page 5: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/5.jpg)
What is Web Site Administration Tool ?
• WAT Allow you to Configure Web Site With Simple Interface – Manage Users – Manage Roles– Manage Access Rules– SMTP Settings– Generate Database (ASPNetDB.mdf)– Debug and Trace – Error Page– Application Settings
![Page 6: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/6.jpg)
How Can I Get It ?
• Easy To Open and Start – Web Site Menu >> And Choose :
• ASP.Net Configuration
– OR in Solution Explorer Window Click on This Button
![Page 7: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/7.jpg)
Home Tab
• Just Navigation Menu to other tabs
![Page 8: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/8.jpg)
Security Tab
• Choose Authentication Type• set up and edit users• Cerate & Manage roles• Set access permissions (Access Rules )
– Authorization
• Allow User ,Role • deny Other
![Page 9: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/9.jpg)
First Step Click Highlight Link
![Page 10: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/10.jpg)
Select authentication type
– Choose From The internet authentication type and Press Done
![Page 11: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/11.jpg)
Come Back Automatically
• Now You Can create and Manage User
![Page 12: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/12.jpg)
Create User
• Fill Your Data and Press Create User
![Page 13: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/13.jpg)
Welcome Member
• Press Continue To Create New User • Or Press Back To Return to Security Tab again
![Page 14: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/14.jpg)
Create Roles
• If You Press Back Will Find this ::– Press Enable Roles To Enable and Create
![Page 15: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/15.jpg)
Enable Roles
• Press Highlight Below To Create
![Page 16: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/16.jpg)
Create Roles
• Enter Role Name and Press Add Role • Repeat Step if You Need More Or Press Back To Finish
![Page 17: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/17.jpg)
Back To Web.Config
• Without Closing Window Switch To Web.Config – Will See this ! Agree Press Yes to All
• Remember that you will See above Dialog Every time you Modify Something in WAT
• Did you Notes Additional information Like This :
<roleManager enabled="true" />
![Page 18: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/18.jpg)
Access Rules
• In other Name Call Authorization – Access Permission– Press Create Access Rules
• Allow/Deny
![Page 19: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/19.jpg)
Allow / Deny
• Admin directory – Allow Administrator Role and Deny Users
![Page 20: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/20.jpg)
Manage Rules
• After Press Ok Press Manage Access Rules– Notes Who is Allowed and Denied !– Who is Allowed and Denied !
![Page 21: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/21.jpg)
Web.Config Again
• In This Case not top root but in Subfolder (Admin)• Dynamically another web.config Created inside
– If you can’t see it in Admin Folder Make a refresh– You will get it’s Content Like This
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<allow roles="Adminstrator" />
<deny users="*" />
</authorization>
</system.web>
</configuration>
![Page 22: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/22.jpg)
Application Tab
• Application Settings • SMTP Settings (Mail) • Application Status • Debugging and Tracing • Define Error Page
![Page 23: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/23.jpg)
Take a Look
![Page 24: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/24.jpg)
Application Settings
• After Press Create Application Settings Enter Your Data – When you Finished Press Save
![Page 25: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/25.jpg)
Add another
• Want to add another key an value Press Add another• Press Ok to return to Application Tab
• Switch to Web.Conifg to See this <appSettings>
<add key="Your" value="SomeValue" />
</appSettings>
![Page 26: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/26.jpg)
Manage Application Settings
• Edit Or Delete – Press Back to return to Parent tab
![Page 27: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/27.jpg)
SMTP Settings
• Press Configure SMTP E-Mail Settings – SMTP = Simple Mail Transfer Protocol
• SMTP responsible For Sending Not receiving
![Page 28: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/28.jpg)
Don’t Forget Web.Config
• After You Can Press OK• Again Switch to Web.Config Will Find Following::• <system.net>
• <mailSettings>
• <smtp from="[email protected]">
• <network host="smtp.yoursite.com" password="xxxxxxx"
userName="admin" />
• </smtp>
• </mailSettings>
• </system.net>
Note :
WAT (Website Adminstration Tool ) Just User interface to Web.Config
![Page 29: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/29.jpg)
Application Status
• Online When Publishing • Offline When Repairing
![Page 30: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/30.jpg)
Taking Applications Offline
• Related with <httpRuntime> • Take an applications Offline will generated This Code in
Web.Config :<system. Web>
<httpRuntime enable="False" />
</system. Web>
• Your Web applications Can’t be Started – Get Error : HTTP 404 (The Resource Can’t be Found )
![Page 31: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/31.jpg)
Debugging and tracing
![Page 32: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/32.jpg)
Debug
![Page 33: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/33.jpg)
Some Details
• Enable debugging ::Check it When Maintain Website– Uncheck :: when Deploy .
• Capture tracing information ::Check it to see More info• Display tracing information on individual pages :: Don’t
check it (will show trace details With Controls in Page )– Uncheck :: show trace in Own Page (trace.axd) type it manually
• Display trace output for ::• Local requests only :: it’s Ok ( only You )• All requests :: Don’t Do this (All user will See it )
• Select the sort order for trace results:: As You Want• Number of trace requests to cache :: Not More• Select which trace results to cache: AS you Want
![Page 34: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/34.jpg)
Default Error Page
• Just Choose Error Page and Press Save
![Page 35: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/35.jpg)
Debug ,Trace , Error PageWeb.Config
• Switch To Web.Config to See the Following :-
<system.web>
<customErrors defaultRedirect="~/ErrorPages/DefaultErrorPage.aspx" />
<trace enabled="true" mostRecent="true" />
<compilation debug="true">
<system.web>
![Page 36: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/36.jpg)
Provider Tab
• Two Choice (all in One Or Different for Each )
![Page 37: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/37.jpg)
Single Provider for All
• Select a single provider for all site management data – One Database For All :
• Membership , Roles, Personalization , Profile
• Make a refresh to See Database in App_Data Folder
![Page 38: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/38.jpg)
Different Providers For Each
• Define One for Membership and One For Roles
![Page 39: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/39.jpg)
Membership in Web.config
• Feel free to return To Part 1,2 will Find Here
http://www.ahmedmoosa.wordpress.com• Custom Membership:: use another Database • Find the way in Part 2 • Don’t forget To Open Generated Database in Solution
Explorer (ASPDB.mdf )
![Page 40: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/40.jpg)
Final Word Help
![Page 41: Web.Config Part 3](https://reader036.fdocuments.net/reader036/viewer/2022062408/56813e06550346895da7e673/html5/thumbnails/41.jpg)
Good Bye
Keep in Touch
For Part 4 ( الله شاء ( إن
Hope this Help
Thanks For Reading