Beruflich Dokumente
Kultur Dokumente
Configuration settings are used to perform the global settings required to be implemented for group of
websites or for a single website / group of web pages within a website.
Machine.Config
Web.Config:
There can be max of only one web.config file present in root folder of the website. Each subfolder of the
website can be max of only one web.config.
Used to create global variable & to store the data i.e required to be stored commonly in group of
webpages.
<add> tag is used to add some value to a key which we can use globally. This tag contains a subtag called
key & value.
When we create appsettings then internally one collection table will be created internally with the name
appSettings.
Ex:-
<appSettings>
<add key="connectionstring" value="server=vamsi;uid=sa;password=sa123" />
<add key="cminbal" value="3000"/>
</appSettings>
Ex:-
if(!IsPostBack)
{
lblMinBalance.Text = "Your Account MinBal is : " +
ConfigurationManager.AppSettings["cminbal"];
}
Ex:
try
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["connstring"]);
con.Open();
Connection strings tag iin web.config is used to store connection string alues with in the web.config file.
This tag is having a sub tag called <add> in this we are having 2 attributes name and connectionString
Ex:-
<connectionStrings>
<add name="sqlcon" connectionString="server=DESKTOP-
70UN8IR\MSSQLSERVER1;uid=sa;password=sa123;database=sample;"/>
</connectionStrings>
try
{
string conn =
ConfigurationManager.ConnectionStrings["sqlcon"].ConnectionString;
SqlConnection con = new SqlConnection(conn);
con.Open();
Web Pages are of 2 types
1. Restricted Pages
2. Non Restricted Pages
1. Authentication
It is a process of checking whether user credentials (userid & password ) are valid or not.
If user credentials are valid user will be given a ticket known as authentication ticket. Always this
authentication ticket will be in the form of cookie.
2. Authorization
It is the process of checking weather an authenticated user has an authorization to access
restricted pages are not.
1. Windows (default)
2. Passport
3. Forms