+ All Categories

[email protected]. .

Date post: 26-Dec-2015
Category:
Upload: lynn-richards
View: 224 times
Download: 0 times
Share this document with a friend
19
Transcript

www.Ahmedmoosa.wordpress.com

Web .config in Xml File . IntelliSense Make It Better Can Configure All Web Site Pages There are Two File

Machine .config Web. Config Can Find Them : (C:\WINDOWS\Microsoft.NET\

Framework\[version]\CONFIG )

Have Default Setting also inweb.config.default Machine.config.default

Enter All Settings Between <Configuration > …. </Configuration >

Case Sensitive Declaration camelCase All Properties Define Namespaces When

Programmatically System .Configuration System.Web.Configuration

Define Your Setting Between it’s Category <System. Web >……</System. Web> <System. Net >…….</System. Net >

configure Page directive Setting s :<pages>

Configure Connection String :<connectionStrings >

Configure Application Setting s:<appSettings>

Configure Error Pages :<customError>

Configure Membership <membership>

You Can Set a lot Of Properties For Example

<pages masterPageFile ="MyMasterPage.master“ theme="myTheme“ >

</pages> Set Namespace

<pages ><namespaces >

<add namespace="System.Data.SqlClient"/>

</namespaces>

</pages> Add Controls Like Ajax Controls

<controls >….<controls>

<Pages> ..</Pages> To All Pages <Location>…</Location> as You Specify

Page - Folder - Subfolder (as you Like ) . Example:-

Set Master Page To Admin Folder only <location path ="Admin">

<system.web>

<pages masterPageFile="AdminMasterPage.master" />

</system.web>

</location>

Can Show friendly Error Set Default Redirect Page URL Show Page by Error Code Like this :<system.web>

<customErrors mode ="On" defaultRedirect ="defaultErrorPage.aspx" > <error statusCode ="404" redirect ="NotFound.aspx"/>

<error statusCode ="500" redirect ="CallSupport.aspx"/>

<error statusCode ="403" redirect ="Forbidden.aspx"/>

</customErrors></system.web> There are A lot Of Details about Will be in My

Blog .

Set Multilanguage Site Working With Resource File (resource.resx

) UiCulture (User interface ) Will Change Like This :

<system.web>

<globalization culture ="auto:ar-eg" uiCulture ="auto" />

</system.web>

Above I set Default Culture To Arabic Egypt

User Interface Will Change as I set In My Internet Option Explorer Sequentially .

It ‘s a page I Call It Manually in Address Bar comes With Extension .axd ( trace.axd ) Show Number of request That Users Call Can Follow all Request in Web Site By

Details Like This :- <system.web>

<trace enabled="true" traceMode="SortByTime" mostRecent="true"

requestLimit="10"

pageOutput="false"

localOnly ="true" />

</system.web>

http://localhost:8080//MyWebsite/trace.xd

Define Data Source , Server and Security In My Visual Web Developer Express

Edition It‘s Like This :<connectionStrings>

<add name="MyConnectionString“

connectionString ="Data Source =.\SQLEXPRESS;

AttachDbFilename=|DataDirectory|\MyDataBaseFile.mdf;

Integrated Security=True;User Instance=True"/>

</connectionStrings>

It Is Simple ( Set and Forget ) Call it any Page You Want .

Define Global Variable using Key and Value.

Example:

<appSettings>

<add key ="MyVariable" value ="SomeValue"/>

</appSettings>

Also Can define more than one variable .

- Note :Can Store Connection Strings

Set Mail Settings (Host info – sender info-…) Mail Settings is under System.Net Category Like :-

<system.net><mailSettings>

<smtp from="[email protected]" > <network

host="smtp.mysite.com" userName ="admin" password =“*********" />

</smtp></mailSettings>

</system.net>

Set Http Runtime Settings Use it When Upload Large Files

<system.web>

<httpRuntime

maxRequestLength ="1048576"

executionTimeout ="3600" />

</system.web>

Note: maxRequestLength in Kb executionTimeout in second

Web Site Compilation Settings And Debug Set Debug To true When Debugging . Better To Set Debug To False When

Deployment Decrease Memory Size Fasts Performance

<system.net>

<compilation debug="true" /></system.net>

define identity (Just User Or Member ) ASP.Net Provide Default Database Call

it (aspnet.mdf) Generate Database Automatically by

using ASP.Net Configuration From Website Menu <system.web>

<authentication mode="forms" /><system.web>

Will be more in My Blog About this Later

Define License To Members in access Rules

Can give License to Group by using Role

Allow Access Pages And deny Others


Recommended