473,378 Members | 1,372 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,378 software developers and data experts.

ViewStates, postBacks and form data

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

Nov 19 '05 #1
2 975
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

"Jason" <ja*************@hotmail.com> ha scritto nel messaggio
news:11**********************@z14g2000cwz.googlegr oups.com...
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

Nov 19 '05 #2
Thanks! I didn't think of that.

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

Nov 19 '05 #3

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

Similar topics

4
by: Ben Barter | last post by:
We have found a fundemental problem with the way that postbacks are handled. We have a page that has about 60 postback controls that are posted back to the server when the user clicks a link...
6
by: Jon Maz | last post by:
Hi All, I am experimenting with URL Rewriting using the techniques outlined by Scott Mitchell in his article "URL Rewriting in ASP.NET"...
1
by: James Lennon | last post by:
I am attempting populate a web form with a dynamic number of check box lists that are generated from data in a SQL Server database. How can I preserve my check box lists accross postbacks without...
3
by: Bruce W.1 | last post by:
I need to do a post on the client side (with an html button) to another aspx URL, while keeping the viewstates. So I made an html button with onClick="location.href='whatever.aspx?state=true'" ...
5
by: Dave | last post by:
(Second Try) Greetings, I have an asp.net web application that utilizes a User Control at the top of the page. My User Control contains a Server Control menu which will require postbacks. ...
3
by: craigkenisston | last post by:
Hi, I am programming a classical registration form using asp.net. I have the country list and a list of all states for each country in a database. I already have this working code in which if...
1
by: Owen | last post by:
Firstly, if this is the wrong newsgroup for my question, please direct me elswhere and accept my apologies! It's a question about ASP.NET but also uses VB.NET classes. This is a little...
1
by: Frankie | last post by:
Just doing some testing here to see what happens when JavaScript is disabled. I was told somewhere along the line that PostBacks would fail because they rely on JavaScript: function...
2
by: tacmec | last post by:
ASP.NET 2.0 (C#) application. I have a web form with a GridView, which is populated dynamically. See the code below. First time to the page, IsPostBack is false. Therefore, DisplayItems() is...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.