Live Chat Icon For mobile
Live Chat Icon

ASP.NET FAQ - Config files

Find answers for the most frequently asked questions
Expand All Collapse All

Drag and Drop the Login Control VS.NET toolbar under Login , change the form name to ‘Login.aspx’.

In the web.config file:

Add the codings given below

<authentication mode='Forms'>
	<forms loginUrl='Login.aspx' protection='All'>
		<credentials passwordFormat='Clear'>
			<user name='Admin' password='Admin'/>
			<user name='Super' password='Super'/>
			<user name='User' password='User'/>

When the user name and corresponding password mentioned above are given , then the login operation will be completed successfully.


In Web.Config, you would add a key to the AppSettings Section:

<add key='MyDBConnection' value='server=<ServerName>;uid=<Username>;pwd=;database=<DBName>' />

Example :

<add key='ConnectionString' value= 'Server=localhost;uid=sa;pwd=;database=northwind' />

Then, in your ASP.Net application – just refer to it like this:

Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings('ConnectionString'))

Share with

Couldn't find the FAQs you're looking for?

Please submit your question and answer.