473,564 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validate and save user

Hello,

I am making a page for employees registration.
First, the employee need to submit a password. This is checked in a database
and returns the companyID where this user shold be saved.
Then, I need to show a usercontrol than displays the registration form. This
usercontrol need the companyID as an input.

I need to understand the way for doing this??
Is there possible to set "usercontrol.vi sible = true" code behind, with an
input (categoryID)? Or is it smart to redirect a new page with the
registrationfor m (then I need to transfer the companyID to this page, I dont
want to do this in the URL)?

Thsi is the code that find the companyID for this employee:

Private Sub btnVerify_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnVerify.Click
Dim SQL As String = "select customerID from tblCustomer where
password=@passw ord and active = '1'"
Dim conn As New SqlConnection(v ariables.ConnSt ring)
Dim cmd As New SqlCommand(SQL, conn)
Dim parameter1 As New SqlParameter("@ password", Me.txtVerify.Te xt)
cmd.Parameters. Add(parameter1)

conn.Open()
Dim dr As SqlDataReader = cmd.ExecuteRead er

while dr.read
'Show usercontrol with registration form....???? How do i do
this?
end while

conn.Close()

conn.Dispose()
cmd.Dispose()
End Sub

I'm stucked!!!
Jan 23 '06 #1
1 1263
Give the usercontrol a public property for what you need it to show just as
you would any other class. This can then be passed in with an overloaded
constructor,
or set after instantiation, or declaratively in the ASPX portion of the page
with attributes.

See the docs for details:

http://msdn.microsoft.com/library/de...properties.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Øyvind Isaksen" wrote:
Hello,

I am making a page for employees registration.
First, the employee need to submit a password. This is checked in a database
and returns the companyID where this user shold be saved.
Then, I need to show a usercontrol than displays the registration form. This
usercontrol need the companyID as an input.

I need to understand the way for doing this??
Is there possible to set "usercontrol.vi sible = true" code behind, with an
input (categoryID)? Or is it smart to redirect a new page with the
registrationfor m (then I need to transfer the companyID to this page, I dont
want to do this in the URL)?

Thsi is the code that find the companyID for this employee:

Private Sub btnVerify_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnVerify.Click
Dim SQL As String = "select customerID from tblCustomer where
password=@passw ord and active = '1'"
Dim conn As New SqlConnection(v ariables.ConnSt ring)
Dim cmd As New SqlCommand(SQL, conn)
Dim parameter1 As New SqlParameter("@ password", Me.txtVerify.Te xt)
cmd.Parameters. Add(parameter1)

conn.Open()
Dim dr As SqlDataReader = cmd.ExecuteRead er

while dr.read
'Show usercontrol with registration form....???? How do i do
this?
end while

conn.Close()

conn.Dispose()
cmd.Dispose()
End Sub

I'm stucked!!!

Jan 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1987
by: Kumar | last post by:
Hi , I am using the article code shown in below url: http://www.codeproject.com/aspnet/xmlxsltransformer.asp?df=100&forumid=118504&select=1170328 This article is very cool feature. I am trying to implement this into my application.
6
2137
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I don´t know much javascript so I wrote a very simple one to validate a form I have on my webpage. could you please have a look at the following script: ------------------------------------------------------------
1
2262
by: L Mehl | last post by:
On my cmdSaveRecord, I check a couple of fields to confirm that an entry has been made before allowing the Save. I decided to - not put validation rules in table structure, and - validate on Save to avoid annoying the user if a field was left empty before clicking cmdSaveRecord For each field validated in this way, I was getting an...
9
6656
by: B-Dog | last post by:
I have a form that has about 10 text boxes on it, they all have to be filled out before submitting is there a quick way to make sure that none are null or do I have to call out each textbox? Say something like textbox1 through textbox10? Thanks
6
1458
by: KMZ_state | last post by:
We have a debate here. We are receiving a CSV file specified by the user and need to validate the contents, writing the "good" records to the database and displaying the "bad" records to the user. One developer wants to loop through the CSV file right on the web layer (ASPX) and then only pass the "good" records onto the DAL. The other...
3
1918
by: Jeff Jarrell | last post by:
I have one textbox on a form. Nothing else. The validate event doesn't fire. Drop another textbox on the form and the validate event fires. Set tabstop = false on the 2nd text box and the validate event on textbox1 doesn't fire again. I now it sounds silly with only one tab stop but it is for a barcode scanner. scan, scan, scan, esc. ...
6
2394
by: Steve Ryan | last post by:
can anyone send me to some good examples of edit in place for data frid columns i see dot net let me assign a control in the IDE any good sources of reading on editing columns with controls and setting styles thanks
29
2513
parshupooja
by: parshupooja | last post by:
Hi, I am working in Asp.Net 2.0, SQL Server, C#. I am trying to create a User Input form which has lots of fields such as : salutation; Firstname: lastname: address: Zip: Phone:
2
6859
nev
by: nev | last post by:
I'm trying to learn how to save changes in my BindingSource. What is Me.Validate()? And do I need it everytime I do save the bindingsource? Is this correct? me.validate() '<-- What is this for? bs.endedit() if not me.adapter.update(datatable) > 0 then msgbox("no records updated.") '<-- When does it not update? end if
3
2281
by: OBA | last post by:
Hi To All.... This Is My First Try To Create A Program Which Compose A Server And 2 Client...i Use Access Database As My Back End And Vb6 As My Front End... Problem 1. I Create A Code In Which A User Can Generate Autonumber But The Problem Is If Two Clients Input Together It Would Both Save The Data To The Server With A...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.