473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

user login control

hi friends:-

I wann to make a login user control. i m using asp.net2.0 with c#. now help me to create this. its behave like a control factory....it means.. i make a contol of login...where ever i wann to use....login conrtol just drag and drop this control to the web page and its run. so if any one have any idea that how i make plz help me..its urgent to me...

thnx
Aug 9 '07 #1
5 1364
you can use master page for the same or use provider facility given by .NET 2.0. If you use <provider> tag then you can use <asp:Login> control. and make it avialble to you.
Aug 9 '07 #2
sir, i think u dnt get my point....i wann to make a login user control in asp.net2.0 with c#, now its availabe to all where ever i wann touse, just drag and drop this control and it will run.

thnx
Aug 9 '07 #3
hello all

....i wann to make a login user control in asp.net2.0 with c#, now its availabe to all where ever i wann to use, just drag and drop this control and it will run.

thnx
Aug 9 '07 #4
RedSon
5,000 Expert 4TB
hello all

....i wann to make a login user control in asp.net2.0 with c#, now its availabe to all where ever i wann to use, just drag and drop this control and it will run.

thnx
Why did you double post your question? Did you not read the Posting Guidelines?
Aug 9 '07 #5
drag and drop the login control in your aspx page and include the following code


protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
try
{
query = "select * from Registration where UserId='" + Login1.UserName + "' and Password='" + Login1.Password + "'";
cmd = new SqlCommand(query, con);
con.Open();
dr = cmd.ExecuteReader();

while (dr.Read())
{

if (dr["UserId"].ToString() == Login1.UserName && dr["Password"].ToString() == Login1.Password)
{
Server.Transfer("Welcome.aspx");
}

}
}
catch (Exception ex)
{
lblmsg.Text = ex.Message;
}
}

This is the procedure to use Login Control
Aug 24 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Martine | last post by:
Hi there! I have a problem with programmatically adding user controls to my mobile webforms. If I load my usercontrol programmatically (in the Page_Load), the object is instantiated, I have...
0
by: Tim T | last post by:
Hi, I have a web application that has a number of users who administer their own data... i have several pages that check to see if a valid userID session exists, and if not, send them to a...
4
by: Michael | last post by:
Thank you for any help you can provide. This is what I have: index.aspx - contains nothing but a form with runat = server header.ascx - contains asp image box welcome.ascx - contains text...
1
by: moondaddy | last post by:
I need to replace a user control on a page with a different user control. The challenge I'm faced with is that this call is being made from the user control being replaced. Normally I replace...
7
by: Samuel | last post by:
Hi, I am building a page that makes use of user control as a templating technique. The following is that I have in mind and it is actually working: Root/ -- login.aspx -- login.aspx.vb --...
0
by: clintonG | last post by:
I applied aspnet_regsql to SQL2K which was working fine throughout Beta 2 development. After installing Visual Studio and SQL Express RTM my application has blown up. Logging in to the application...
0
by: Mad Scientist Jr | last post by:
my login user control has this public property, passed from the calling page: Public TableContent As Table is this byref? if not how can it be made so? when the user logs in, the user...
13
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas?...
3
by: =?Utf-8?B?RHVrZSAoQU4yNDcp?= | last post by:
The majority of pages on our site need authentication (forms auth against the aspnetdb database). I created an '~/auth' folder with its own config file forcing authentication for any pages in the...
12
by: tvnaidu | last post by:
I have Two kinds of web pagess, one is for control page for only admin login, another one is to view status for user login. initially both html files can view with 192.168.0.10/control.htm and other...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.