ViewStates, postBacks and form data

J

Jason

I am pretty new to .NET and I need a little guidance...

I have a generic "add user" form. When the user fills out the form, I
check to see if the username is unique in the datasource. If it's not,
I want to postBack to the original form, populating all of the data
except for the username so the user can enter a new username. I have
the form built, and the function to check the username, but I can't
seem to find how to execute the postback or load information from the
postBack.

Can someone point me to a document that would explain this to me? I
have been searching for a while, but can't seem to come up with the
right combination of words for a search phrase. I'm sure there is a
plethora of documentation about this, I just can't seem to find it!

Thanks in advance.
Jason
 
S

Stefano

Hi Jason,

I think you can start from here:
http://www.asp.net/Tutorials/quickstart.aspx

You need to use an <asp:button>, and manage its Click server side. Here you
can run your routine to check if the username already exists on file, so, if
exists you can put an empty string for the textbox:

MyUsername.Text = "";

HTH

Bye

Stefano
 
J

Jason

Thanks! I didn't think of that.

Still trying to convert ALL of my thinking from classic ASP to ASP.NET!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top