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

Where to put validation code, for a FormView control

Hi
I want to put all my validation code in one place, for my FormView control,
regardless of whether its editing or inserting data.

Is there a 'Validation' event somewhere??

or do I point the ItemUpdating and ItemInserting events to the same place,
and put my validation code there?

Thanks
Feb 14 '06 #1
1 6919
I can understand your desire to find a Validation event. ASP.NET does
validation differently. You add Validation web controls throughout the page
to establish both the rules and visual presentation.

The "validation event" is really a call to the Page.Validate() method, which
goes through all validators (matching the validation group of the button) to
ask them to validate themselves. You check the results of that process by
confirming Page.IsValid is true in your post back event handler.

There are numerous articles and tutorials for ASP.NET validation on the web,
including in the Tutorials tab on this site. I put together an article that
fills in some of gaps: http://aspalliance.com/699.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:GH*****************@fe2.news.blueyonder.co.uk ...
Hi
I want to put all my validation code in one place, for my FormView
control, regardless of whether its editing or inserting data.

Is there a 'Validation' event somewhere??

or do I point the ItemUpdating and ItemInserting events to the same place,
and put my validation code there?

Thanks

Feb 14 '06 #2

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

Similar topics

1
by: TdarTdar | last post by:
I wanted to add three columns up on the form and run some logic to fill in the third but not sure how to call the field names in the formview control. Dim Girth As Integer Elenght =...
1
by: sck10 | last post by:
Hello, I am pulling data from a SQL Server table. One field that is (varchar 4000) is used to show notes. I am using a FormView for showing and editing the data. When the form is in Item...
3
by: sck10 | last post by:
Hello, I am trying to bind an arraylist to a FormView DropDownList control in the PreRender state. The error that I get is the following: Databinding methods such as Eval(), XPath(), and...
2
by: Tim | last post by:
I have a radio button list control in the edit item template of a formview, as below. I want to bind this to a bit field from my sql database, however I can't seem to figure it out. Could some...
2
by: wikkiwikkiwaa | last post by:
hello, i am trying to access controls inside my formview1 nested inside loginview1. you cannot access the formview1 unless you are properly logged in. for loginview1, that seems to be fairly...
1
by: Q. John Chen | last post by:
I have Validation controls on FormView. ClientScripts is enabled FormView's DefaultMode is ReadOnly. And I have button so it will swith to Insert or Edit mode. To be specific, I have a...
6
by: Mr. SweatyFinger | last post by:
hi. i have a bunch of controls that get validated with the validation controls in vs2005 there are two that i could not find a control for so i wrote some javascript. so i set my submit...
3
by: J055 | last post by:
Hi I've been puzzling over this one for a while now. I'm not really sure what the best and cleanest approach would be here. This is what I want to do. A User enters some values in a FormView...
0
by: Ned Balzer | last post by:
I posted this this morning but it never went through, so I am trying again -- apologies for the duplication if so. I need to validate several checkboxes on an asp.net 2.0 page. I don't need to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.