G
Guest
Hi.
We have a framework that we work with for our project. So far we
have had very good success – basically the frame work wraps many day to day
tasks so that they are all included in the project. The framework is built on
a modified Page Controller pattern in which a aspx page controls the loading
of clients (user controls) into a placeholder (Sort of similar to .net 2.0
Master Pages except that the page loads the client not the client loads the
page) – and therefore it can provide many services to the client controls –
such as logging, Home page layout, Request parameter validation , session
introspection (for customer support) , ui messaging (i.e. Messageboxing) etc…
The problem we are having is with validation. Using the standard
asp.net server side validation the developer has to include an explicit
validation check in a posted back event i.e
If (Page.IsValid)
{
Do stuff
}
If page.isvalid is not checked then the code will run even if the values in
the controls are flat out wrong.
One of the aims of our framework is too automatically take care
of as many things as we can offload off the developer – this is something
that is probably ripe for inclusion – basically what I am looking for is a
way to interrupt the page load process so that we can stop postback events
from firing if the page is not valid.
I cannot find anyway of interrupting the validation process.
Ideally I want be able to stop the actual code written in the postback events
(such as onselection changed) from firing. The problem is that I do not see
anywhere that I can hook into this. I want to catch it after it has applied
the values to the controls and before it actually calls the postback events
however everything is marked as private.
I did think about actually unassigning the postback events in
onload (after validation) - however there are so many different types of
events I would have to look for - Including many controls that I do not
currentlly have (third Party). However ifI don't have a choice I might have
to resort to that.
Does any one have any ideas?
Thanks
We have a framework that we work with for our project. So far we
have had very good success – basically the frame work wraps many day to day
tasks so that they are all included in the project. The framework is built on
a modified Page Controller pattern in which a aspx page controls the loading
of clients (user controls) into a placeholder (Sort of similar to .net 2.0
Master Pages except that the page loads the client not the client loads the
page) – and therefore it can provide many services to the client controls –
such as logging, Home page layout, Request parameter validation , session
introspection (for customer support) , ui messaging (i.e. Messageboxing) etc…
The problem we are having is with validation. Using the standard
asp.net server side validation the developer has to include an explicit
validation check in a posted back event i.e
If (Page.IsValid)
{
Do stuff
}
If page.isvalid is not checked then the code will run even if the values in
the controls are flat out wrong.
One of the aims of our framework is too automatically take care
of as many things as we can offload off the developer – this is something
that is probably ripe for inclusion – basically what I am looking for is a
way to interrupt the page load process so that we can stop postback events
from firing if the page is not valid.
I cannot find anyway of interrupting the validation process.
Ideally I want be able to stop the actual code written in the postback events
(such as onselection changed) from firing. The problem is that I do not see
anywhere that I can hook into this. I want to catch it after it has applied
the values to the controls and before it actually calls the postback events
however everything is marked as private.
I did think about actually unassigning the postback events in
onload (after validation) - however there are so many different types of
events I would have to look for - Including many controls that I do not
currentlly have (third Party). However ifI don't have a choice I might have
to resort to that.
Does any one have any ideas?
Thanks