0% found this document useful (0 votes)
349 views6 pages

ASP.NET 3.5 Login Control Guide

The document discusses the login control in ASP.NET 3.5. It provides instructions on how to add a login control to a web form, configure it, and handle authentication. The login control handles user authentication using ASP.NET membership without requiring additional code. It also describes adding links, styles, and handling error messages for the login control.

Uploaded by

Saurabh Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
349 views6 pages

ASP.NET 3.5 Login Control Guide

The document discusses the login control in ASP.NET 3.5. It provides instructions on how to add a login control to a web form, configure it, and handle authentication. The login control handles user authentication using ASP.NET membership without requiring additional code. It also describes adding links, styles, and handling error messages for the login control.

Uploaded by

Saurabh Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

3/28/12

Total Online Users: 12231

Login Control in [Link] 3.5


How to post a Blog?

Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training | Consulting Search : Home Learn .NET Login Control in [Link] 3.5 Go

S bmi an Ar icle

Hi! saurabh Logout My Account My Messages (0) Jump to Technology Website Sponsored b

Advanced Search

Login Control in [Link] 3.5


B Raj Kumar Jul 28, 2008
step tutorial, I am going to discuss the Login control available in [Link] 3.5. In this step b

Print Email to a friend

Post a comment Bookmark

Similar Articles Author's other articles

Do

nload Files:

LoginControl. ip

The [Link] login controls provide a robust login solution for [Link] Web applications without requiring programming. By default, login controls integrate with [Link] membership and forms authentication to help automate user authentication for a Web site. It provides you with a ready-to-use user interface that queries the user name and password from the user and offers a Log In button for login. It validate user credentials against the membership API and encapsulating the basic froms authentication functionality like redirecting back to the original requested page in a restricted area of you application after the successful login. The Login control displays a user interface for user authentication. The Login control contains text boxes for the user name and password and a check box that allows users to indicate whether they want the server to store their identity using [Link] membership and automatically be authenticated the next time they visit the site. The Login control has properties for customized display, for customized messages, and for links to other pages where users can change their password or recover a forgotten password. The Login control can be used as a standalone control on a main or home page, or you can use it on a dedicated login page. If you use the Login control with [Link] membership, you do not need to write code to perform authentication. However, if you want to create your own authentication logic, you can handle the Login control's Authenticate event and add custom authentication code. Note - Login controls might not function correctly if the Method of the [Link] Web page is changed from POST (the default) to GET. Start Microsoft Visual Studio 200 Create a new [Link] WebSite, Like this:

[Link]/uploadfile/raj1979/login-control-in-asp-net-3-5/?login=true&user=sabh007@

1/11

3/28/12

Login Control in [Link] 3.5

Become a Sponsor Resources About Us [Link] Hosting Authors Book Chapters Book Reviews C# Consulting C# Training Downloads Media Kit News & Events Prizes Product Reviews Resources Tips Tools User Groups Our Network .NET Heaven C# Corner DbTalks Interview Corner Longhorn Corner Mindcracker [Link] Heaven

[Link]/uploadfile/raj1979/login-control-in-asp-net-3-5/?login=true&user=sabh007@

2/11

3/28/12

Login Control in [Link] 3.5

Drang and drop Login control on page from ToolBox.

[Link]/uploadfile/raj1979/login-control-in-asp-net-3-5/?login=true&user=sabh007@

3/11

3/28/12

Login Control in [Link] 3.5

Figure .

Whenever user hits the Log In button, the control automatically validates the user name and password using the me and then calls [Link]() if the validation was successful. All options on the UI of control to these methods. For Example, if you click the "Remember me next time" check box, it passes the value true RedirectFromLoginPage() method. Therefore, the FormAuthenticateModule creates a persistent cookie. There are three Login Tasks by default.

Auto Format - you can select default schemes. Convert To Template - You can edit content of Login Control. Administer Website - You can configure Web Site Administration Tools, Like Security, Application, Provider.

Figure .
<omi=fr1 rnt"evr> fr d"om" ua=sre" <i> dv <s:oi I=Lgn"rnt"evr BcClr"FFD"BreClr"CC9"BreSye apLgn D"oi1 ua=sre" akoo=#77E odroo=#CC9 odrtl Nms"edn"Fn-ie"0t> ae=Vraa otSz=1p" <ilTxSyeBcClr"666"Fn-od"re FrClr"FFF"/ Tteettl akoo=#B9B otBl=Tu" oeoo=#FFF > <apLgn /s:oi> <dv /i> <fr> /om

You can change styles of LoginControl using css too, Like this:
.oiCnrl Lgnoto { bcgon-oo:FFD; akrudclr#77E bre-oo:CC9; odrclr#CC9 bre-tl:oi; odrsyesld bre-it:p; odrwdh1x fn-aiyVraa otfml:edn; fn-ie1p; otsz:0x Adnwapycst cnrl n o pl s o oto: <tlxls"tp/www.r/99xtl> hm mn=ht:/w.3og19/hm" <edrnt"evr> ha ua=sre" <il>oi Cnrl/il> tteLgn oto<tte <ikhe=Syehe.s"tp=tx/s"rl"tlset / ln rf"tlSetcs ye"etcs e=Syehe" > <ha> /ed <oy bd> <omi=fr1 rnt"evr> fr d"om" ua=sre" <i> dv <s:oi I=Lgn"rnt"evr Csls=Lgnoto" apLgn D"oi1 ua=sre" sCas"oiCnrl> <ilTxSyeBcClr"666"Fn-od"re FrClr"FFF"/ Tteettl akoo=#B9B otBl=Tu" oeoo=#FFF > <apLgn /s:oi> <dv /i> <fr> /om [Link]/uploadfile/raj1979/login-control-in-asp-net-3-5/?login=true&user=sabh007@ 4/11

3/28/12

<fr> /om <bd> /oy <hm> /tl

Login Control in [Link] 3.5

If you running the page and if the CSS file is placed in a directory where anonymous access is denied, the add you web config file
<oainpt=Syehe.s" lcto ah"tlSetcs> <ytmwb sse.e> <uhrzto> atoiain <lo ues""> alw sr=*/ <atoiain /uhrzto> <sse.e> /ytmwb <lcto> /oain

You can add several hyperlinks to your Login control, such as hyperlink to a help text page, or a hyperlink to to a regi
<s:oi I=Lgn"rnt"evr Csls=Lgnoto" apLgn D"oi1 ua=sre" sCas"oiCnrl CetUeTx=Rgse" raesret"eitr CetUeUl"/eitrap" raesrr= [Link] HlPgTx=Adtoa Hl"HlPgUl"/epap" epaeet"diinl ep epaer= [Link] Isrcinet"laeetryu ue nm adpswr frlgn" ntutoTx=Pes ne or sr ae n asod o oi.> <ilTxSyeBcClr"666"Fn-od"re FrClr"FFF"/ Tteettl akoo=#B9B otBl=Tu" oeoo=#FFF > <apLgn /s:oi>

Looks like this :

Here is .CS Code:


uigSse; sn ytm [Link]; sn ytmCletosGnrc [Link] sn ytmLn; uigSse.e; sn ytmWb uigSse.e.I sn ytmWbU; [Link] sn [Link]; [Link] sn [Link]; pbi prilcas_eal :[Link] ulc ata ls Dfut [Link] { poetdvi Pg_odojc sne,Eetrse rtce od aeLa(bet edr vnAg ) { i ([Link] f !hsIPsBc) VeSae"oiErr" =0 iwtt[Lgnros] ;

poetdvi Lgn_uhniaeojc sne,AtetctEetrse rtce od oi1Atetct(bet edr uhniaevnAg ) { i ([Link] [Link]) f YuVldtoFnto(oi1UeNm, oi1Pswr) { / eAtetctd=tu; / .uhniae re [Link] =fle oi1Vsbe as; [Link]="ucsflyLge I" esgLblTx Scesul ogd n; es le { eAtetctd=fle .uhniae as;
[Link]/uploadfile/raj1979/login-control-in-asp-net-3-5/?login=true&user=sabh007@ 5/11

3/28/12

Login Control in [Link] 3.5

poetdvi Lgn_oiErrojc sne,Eetrse rtce od oi1Lgnro(bet edr vnAg ) { i (iwtt[Lgnros]= nl) f VeSae"oiErr" = ul VeSae"oiErr" =0 iwtt[Lgnros] ; itErron =(n)iwtt[Lgnros]+1 n roCut itVeSae"oiErr" ; VeSae"oiErr" =Erron; iwtt[Lgnros] roCut i (Erron >3 & (oi1PswrRcvrUl! [Link]) f (roCut ) & [Link] = tigEpy) [Link]) epneRdrc(oi1PswrRcvrUl;

piaebo YuVldtoFnto(tigUeNm,srn Pswr) rvt ol oraiainucinsrn srae tig asod { bo boRtrVle=fle ol oleunau as; srn sroncin="[Link]=edruds;w=itlet" tig tCneto sre=;aaaeVno;i=apdwnelc;; Sloncinsloncin=nwSloncinsroncin; qCneto qCneto e qCneto(tCneto) Srn SLur ="EETUeNm,Pswr FO Lgn; tig QQey SLC srae asod RM oi" Slomn cmad=nwSlomn(QQey sloncin; qCmad omn e qCmadSLur, qCneto) SlaaedrD; qDtRae r sloncinOe(; [Link]) D =cmadEeueedr) r [Link](; wie(rRa() hl [Link]) { i (UeNm = D[UeNm".otig) &(asod= D[Pswr".otig f (srae = r"srae]TSrn() Pswr = r"asod]TSrn { boRtrVle=tu; oleunau re [Link](; rCoe) rtr boRtrVle eun oleunau; rtr boRtrVle eun oleunau;

If you insert wrong username and password then message will show like this:

If you insert right usename, password then redirect your page whereever you want or you can show message in Error

I am attaching my database with application in App_Data folder, if u want use my database then attach my .MDF file Any question and queries ask me any time.
Comment Request!
Thank ou for reading this post. Please post our feedback, question, or comments about this post Here.
Add your contents and source code to this article

Article E tensions
Contents added by Ganesh on Feb 05, 2010 but how to configure website administration tool and how to strore username and password in login folder of pur database?

[Link]/uploadfile/raj1979/login-control-in-asp-net-3-5/?login=true&user=sabh007@

6/11

You might also like