Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > LoadControl and Validation Summary

Reply
Thread Tools

LoadControl and Validation Summary

 
 
Doug Heeren
Guest
Posts: n/a
 
      12-29-2005
I am working on a project that dynamically loads controls from within
Page_init so that the viewstate is preserved. On post back the control saves
it's changs in the Page_load event. If the user navigates to another section
the control is removed in the page load event and a second control is loaded
by the button fire event. This all works very well, but when I add a
validation summary to the parent page I run into an issue.

The first control to load works fine, when the user navigates to another
section the second control is loaded and appears to work, but when the user
tries to navigate to a third section the validation summary lists all the
controls in the first control to load as being in error since there is no
data in them.

What is going on here and how do I "reset" the validation summary? I'd post
the code, but there are about 500 lines of it in the parent page. I figure
the answer is farily simple and lies in a lack of understanding on my part
about loading/unloading controls dymacially, but I can't seem to find
anything on a search engine that is of much use in explaining this to me.

Any help will be highly appreciated,

--
Doug Heeren
Project Manager
Annett Holdings, Inc.
(515) 256-2918
 
Reply With Quote
 
 
 
 
Mike MacMillan
Guest
Posts: n/a
 
      12-30-2005
Doug,
if i understand correctly, you're having issues with the wrong set of
controls being validated for certain steps. are you persisting
(perhaps hardcoding...?) which controls are bound to each step
somewhere? this sounds like you have a multi step wizard type app
wrapped into a single .aspx page. perhaps you can abstract each
section/step to its own user control, that way the parent page can call
a .Validate method so each step only validates its own controls.
seperating the logic for each step will allow you quite a bit more
flexibility. let me know if im not understanding your issue correctly.
if you can provide some code snippets that somewhat explain your
architecture, it will help diagnosing your issue.

hope this helps,
Mike MacMillan



Doug Heeren wrote:
> I am working on a project that dynamically loads controls from within
> Page_init so that the viewstate is preserved. On post back the control saves
> it's changs in the Page_load event. If the user navigates to another section
> the control is removed in the page load event and a second control is loaded
> by the button fire event. This all works very well, but when I add a
> validation summary to the parent page I run into an issue.
>
> The first control to load works fine, when the user navigates to another
> section the second control is loaded and appears to work, but when the user
> tries to navigate to a third section the validation summary lists all the
> controls in the first control to load as being in error since there is no
> data in them.
>
> What is going on here and how do I "reset" the validation summary? I'd post
> the code, but there are about 500 lines of it in the parent page. I figure
> the answer is farily simple and lies in a lack of understanding on my part
> about loading/unloading controls dymacially, but I can't seem to find
> anything on a search engine that is of much use in explaining this to me.
>
> Any help will be highly appreciated,
>
> --
> Doug Heeren
> Project Manager
> Annett Holdings, Inc.
> (515) 256-2918


 
Reply With Quote
 
 
 
 
Doug Heeren
Guest
Posts: n/a
 
      12-30-2005
Mike,
You are correct about the nature of the application. Only one control is
loaded at a time, the problem I am having, I belive, is because I've set
showsummary = False and showmessagebox = true on the validation summary. Is
the javascript for the validation summary cached? I've not hardcoded anything
each controls validate method is being called, but it is on the client side
where I am having issues. I wasn't very clear about in my post.

I've tried to remove all the validators from the summary after I am done
saving the changes that the user made before moving on to load the next
control, but on the client side it is still trying to do something with a
control that has not even loaded. Is there something I need to do (syncroot)
with the page or validation summary?

Thanks in advance,

Doug
--
Doug Heeren
Project Manager
Annett Holdings, Inc.
(515) 256-2918


"Mike MacMillan" wrote:

> Doug,
> if i understand correctly, you're having issues with the wrong set of
> controls being validated for certain steps. are you persisting
> (perhaps hardcoding...?) which controls are bound to each step
> somewhere? this sounds like you have a multi step wizard type app
> wrapped into a single .aspx page. perhaps you can abstract each
> section/step to its own user control, that way the parent page can call
> a .Validate method so each step only validates its own controls.
> seperating the logic for each step will allow you quite a bit more
> flexibility. let me know if im not understanding your issue correctly.
> if you can provide some code snippets that somewhat explain your
> architecture, it will help diagnosing your issue.
>
> hope this helps,
> Mike MacMillan
>
>
>
> Doug Heeren wrote:
> > I am working on a project that dynamically loads controls from within
> > Page_init so that the viewstate is preserved. On post back the control saves
> > it's changs in the Page_load event. If the user navigates to another section
> > the control is removed in the page load event and a second control is loaded
> > by the button fire event. This all works very well, but when I add a
> > validation summary to the parent page I run into an issue.
> >
> > The first control to load works fine, when the user navigates to another
> > section the second control is loaded and appears to work, but when the user
> > tries to navigate to a third section the validation summary lists all the
> > controls in the first control to load as being in error since there is no
> > data in them.
> >
> > What is going on here and how do I "reset" the validation summary? I'd post
> > the code, but there are about 500 lines of it in the parent page. I figure
> > the answer is farily simple and lies in a lack of understanding on my part
> > about loading/unloading controls dymacially, but I can't seem to find
> > anything on a search engine that is of much use in explaining this to me.
> >
> > Any help will be highly appreciated,
> >
> > --
> > Doug Heeren
> > Project Manager
> > Annett Holdings, Inc.
> > (515) 256-2918

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Summary not showing for client side validation cwhankey@gmail.com ASP .Net 1 12-12-2008 02:32 AM
Executing and rendering user controls via LoadControl and RenderControl Deane ASP .Net Building Controls 0 09-03-2007 08:47 PM
Using Summary Validation control with server Custom validation =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= ASP .Net 2 10-15-2004 06:15 PM
Displaying a Validation Error in a Validation Summary Control Lucas Tam ASP .Net 2 02-26-2004 07:49 PM
validation summary doesnt display when there's client-side validation Libs ASP .Net 0 06-25-2003 03:05 PM



Advertisments