Distinguishing between two forms on a single page for validation

M

Maziar Aflatoun

Hi,

I have two sections on one .aspx page. One is a datagrid which lists the
current users allowing you to edit them as well and on the bottom of my page
I have 'Add a new user' section with two textboxes (Username and password).
I know how to apply asp:requiredfieldvalidator to my textboxes for both the
datagrid and the insert new user section. Now, how do I distinguish between
the two? since sometimes you click update to update the datagrid and
sometimes you click on insert new to add a new user and using for ex.

if (!Page.IsValid)
{
lblMsg.Text = "* = Required Field";
}

checks the all the textboxes.

Thank you
Maz.
 
S

Steve C. Orr [MVP, MCSD]

It's easy to do in .NET 2.0, but that doesn't come out until next year :-/
Until then you'll have to do some custom validation.
The easiest way is to turn off the client side validation and just handle it
in your server side code.
 

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,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top