Top Banner
19

[email protected]. .

Dec 26, 2015

Download

Documents

Lynn Richards
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 2: Ahmed_Moosa83@yahoo.com. .

www.Ahmedmoosa.wordpress.com

Page 3: Ahmed_Moosa83@yahoo.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

Page 4: Ahmed_Moosa83@yahoo.com. .

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 >

Page 5: Ahmed_Moosa83@yahoo.com. .

configure Page directive Setting s :<pages>

Configure Connection String :<connectionStrings >

Configure Application Setting s:<appSettings>

Configure Error Pages :<customError>

Configure Membership <membership>

Page 6: Ahmed_Moosa83@yahoo.com. .
Page 7: Ahmed_Moosa83@yahoo.com. .

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>

Page 8: Ahmed_Moosa83@yahoo.com. .

<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>

Page 9: Ahmed_Moosa83@yahoo.com. .

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 .

Page 10: Ahmed_Moosa83@yahoo.com. .

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 .

Page 11: Ahmed_Moosa83@yahoo.com. .

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>

Page 12: Ahmed_Moosa83@yahoo.com. .

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

Page 13: Ahmed_Moosa83@yahoo.com. .

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 .

Page 14: Ahmed_Moosa83@yahoo.com. .

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

Page 15: Ahmed_Moosa83@yahoo.com. .

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>

Page 16: Ahmed_Moosa83@yahoo.com. .

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

Page 17: Ahmed_Moosa83@yahoo.com. .

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>

Page 18: Ahmed_Moosa83@yahoo.com. .

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

Page 19: Ahmed_Moosa83@yahoo.com. .

Define License To Members in access Rules

Can give License to Group by using Role

Allow Access Pages And deny Others