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

Where in the page lifecycle does validation occur?

Hi all,

I don't use auto postbacks on my web site to keep it javascript-free
and browser agnostic. Whenever there's a postback to my page I'm using
the Page_Load event to use the posted data for database updates.
However, the page hasn't been validated at this point. I can call
Validate() at this point, but this means the controls will be validated
twice.

At what point in the page lifecycle are the controls validated? When
would be the best time and place to use the posted data for a database
update, if not using auto postbacks? My current method doesn't seem
ideal.

Thanks in advance,

Paul

Aug 25 '06 #1
3 1287

Validate() at this point, but this means the controls will be validated
twice.
You can disable it by .CausesValidation property
At what point in the page lifecycle are the controls validated? When
would be the best time and place to use the posted data for a database
update, if not using auto postbacks? My current method doesn't seem
ideal.

After Page_Load.

http://msdn2.microsoft.com/en-us/library/ms178472.aspx

Regards
Nirmal

Aug 25 '06 #2
Thanks Nirmal,

If I don't want to use button events (to avoid the need for javascript)
where's the best place to check if the posted data is valid and do
database updates, redirects etc.?

Thanks,

Paul

ni******@gmail.com wrote:
Validate() at this point, but this means the controls will be validated
twice.

You can disable it by .CausesValidation property
At what point in the page lifecycle are the controls validated? When
would be the best time and place to use the posted data for a database
update, if not using auto postbacks? My current method doesn't seem
ideal.


After Page_Load.

http://msdn2.microsoft.com/en-us/library/ms178472.aspx

Regards
Nirmal
Aug 25 '06 #3
Paul , You are the best person to judge based on your apps behavior.

However I might end up doing it at LoadComplete.

Paul wrote:
Thanks Nirmal,

If I don't want to use button events (to avoid the need for javascript)
where's the best place to check if the posted data is valid and do
database updates, redirects etc.?

Thanks,

Paul

ni******@gmail.com wrote:
Validate() at this point, but this means the controls will be validated
twice.
You can disable it by .CausesValidation property
At what point in the page lifecycle are the controls validated? When
would be the best time and place to use the posted data for a database
update, if not using auto postbacks? My current method doesn't seem
ideal.

After Page_Load.

http://msdn2.microsoft.com/en-us/library/ms178472.aspx

Regards
Nirmal
Sep 8 '06 #4

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

Similar topics

3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
0
by: Epson Barnett | last post by:
I'm new to ASP.NET and have run across a problem several times while working on web apps. I often need to create content dynamically (based on an event) which contains dynamically created...
2
by: Sam | last post by:
I have a custom control (MyTextBox - taken from Microsoft website) that implements the IPostBackDataHandler interface. It is added to the controls collection of a placeholder control during the...
1
by: Dan Sikorsky | last post by:
I'm using SmartNavigation and need to automatically scroll to the top of the page when the ValidationSummary control catches errors and displays them, so that the user can see the errors without...
2
by: Frankie | last post by:
I have a user control into which I insert a bunch of controls dynamically. I have it all working just fine - Everything is there on Postback, etc. I load this user control into a hosting ASPX...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
4
by: Jeremy Holt | last post by:
Hi, In a windows.forms application I would BeginInvoke a delegate on the UI thread to collect data from a database. When the call returns to the AsyncCallback, if the Control.InvokeRequired =...
5
by: Piotr Strycharz | last post by:
Hi I want to render a page in memory. That is (pseudo-code): Page aPage = new Page(); LiteralControl lc = new LiteralControl("<form runat=server><asp:Label id=label Runat=server/>...");...
0
by: paul.hester | last post by:
Hi all, I don't use auto postbacks on my web site to keep it javascript-free and browser agnostic. Whenever there's a postback to my page I'm using the Page_Load event to use the posted data for...
2
by: Gary W. Smith | last post by:
I have a page that inherits from a base page that is currently overriding all of the On* events. For the most part I'm accomplishing everything I set out to do with the inheritance, but I wanted...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.