Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Validation with DetailView

 
Thread Tools Search this Thread
Old 08-30-2006, 06:13 PM   #1
Default Validation with DetailView


I have a form that has two gridviews for displaying data, two details
view are associated with the gridviews. The details views are used for
inserting individual records, which are then displayed by the
gridviews. The records are inserted by using the auto generated insert
buttons in the details view. There are also several text boxes that
need to be saved off to the DB when a button is pressed. There are
several validates contained in the detailsviews. I want them to
validate only inside of their respective detailsviews, not the entire
page.

>From my understanding of how validate groups work, you can set the

validatorgroup property of a button to be the same as those of the
validates and then you can have several different groups which will be
independent of each other.

The problem that I am having is that I can not find the ValidationGroup
property for the insert link in the detailsview. This means that I have
to have values filled in both detailsviews to be able to submit one of
them.

Do I need to generate the buttons myself and then set the
validationgroup property?



bmayer@mnepilepsy.net
  Reply With Quote
Old 08-30-2006, 06:43 PM   #2
Kyle K.
 
Posts: n/a
Default Re: Validation with DetailView
Try this...

- In Design mode, open the DetailsView Tasks window by clicking the
little arrow at the top-right of the control and click the 'Edit
fields...' link.
- In the dialog the opens up, select the 'CommandField' entry in the
'Selected fields:' box in the bottom-left.
- In the 'CommandField Properties:' box on the right, assign
CausesValidation = 'true' and ValidationGroup = '(group you defined)'.

This should have the effect you are looking for.

-={ Kyle }=-


wrote:
> I have a form that has two gridviews for displaying data, two details
> view are associated with the gridviews. The details views are used for
> inserting individual records, which are then displayed by the
> gridviews. The records are inserted by using the auto generated insert
> buttons in the details view. There are also several text boxes that
> need to be saved off to the DB when a button is pressed. There are
> several validates contained in the detailsviews. I want them to
> validate only inside of their respective detailsviews, not the entire
> page.
>
>>From my understanding of how validate groups work, you can set the

> validatorgroup property of a button to be the same as those of the
> validates and then you can have several different groups which will be
> independent of each other.
>
> The problem that I am having is that I can not find the ValidationGroup
> property for the insert link in the detailsview. This means that I have
> to have values filled in both detailsviews to be able to submit one of
> them.
>
> Do I need to generate the buttons myself and then set the
> validationgroup property?
>



Kyle K.
  Reply With Quote
Old 08-30-2006, 06:53 PM   #3
bmayer@mnepilepsy.net
 
Posts: n/a
Default Re: Validation with DetailView
Perfect! Thank you.


Kyle K. wrote:
> Try this...
>
> - In Design mode, open the DetailsView Tasks window by clicking the
> little arrow at the top-right of the control and click the 'Edit
> fields...' link.
> - In the dialog the opens up, select the 'CommandField' entry in the
> 'Selected fields:' box in the bottom-left.
> - In the 'CommandField Properties:' box on the right, assign
> CausesValidation = 'true' and ValidationGroup = '(group you defined)'.
>
> This should have the effect you are looking for.
>
> -={ Kyle }=-
>
>
> wrote:
> > I have a form that has two gridviews for displaying data, two details
> > view are associated with the gridviews. The details views are used for
> > inserting individual records, which are then displayed by the
> > gridviews. The records are inserted by using the auto generated insert
> > buttons in the details view. There are also several text boxes that
> > need to be saved off to the DB when a button is pressed. There are
> > several validates contained in the detailsviews. I want them to
> > validate only inside of their respective detailsviews, not the entire
> > page.
> >
> >>From my understanding of how validate groups work, you can set the

> > validatorgroup property of a button to be the same as those of the
> > validates and then you can have several different groups which will be
> > independent of each other.
> >
> > The problem that I am having is that I can not find the ValidationGroup
> > property for the insert link in the detailsview. This means that I have
> > to have values filled in both detailsviews to be able to submit one of
> > them.
> >
> > Do I need to generate the buttons myself and then set the
> > validationgroup property?
> >




bmayer@mnepilepsy.net
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to give email validation inside a textbox in C# windows application(VS 2005)? Vayalumkal Software 1 10-14-2008 07:28 PM
C#, Server validation paul_singh Software 0 09-23-2008 02:34 PM
on submit validation with Master Page in ASP.net 2.0 dipesh10 Software 0 06-27-2007 02:33 PM
How we can do validation with velocity macro tags HemantS Software 0 06-12-2007 04:58 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46