ViewStates, postBacks and form data

  • Thread starter Thread starter Jason
  • Start date Start date
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
 
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
 
Thanks! I didn't think of that.

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