Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Newbie: Problem with usercontrol and webform

Reply
Thread Tools

Newbie: Problem with usercontrol and webform

 
 
Pablo Apanasionek
Guest
Posts: n/a
 
      12-08-2004
Hey, i'm getting started with ASP.NET and C# and i got into this problem:
I have a user control that works as a header (user information, logo, date,
etc) that has two textboxes and a button, which do the work for user login.
This header persists through the whole webapp. The textboxes are validated
with two required validator controls (user and password).
On the other hand, i have a form that does the user registration (for new
users). The problem arrives when i try to submit this form and there is no
data on the header's textboxes: the req field validators activate and i am
stopped there.

I guess the Click event on the 2nd form is triggering validators on the 1st
one, is there a way to make them independant?

Thanks in advance
Pablo Apanasionek
www.dreamovate.com.ar


 
Reply With Quote
 
 
 
 
mortb
Guest
Posts: n/a
 
      12-09-2004
I think you will have to either expose the validators in the code behid of
the user control so that you can disable them from the page that the control
is on
or expose a function that disables them

codbeind usercontrol:

public void DisableValdators()
{
validator1.Enabled = false;
...
}

webform.aspx:

<uc1:YourUserControl id="loginControl"></uc1:YourUserControl>

code behind webform

protected YourUserControl loginControl;

private Page_Load(object sender, System.EventArgs e)
{
loginControl.DisableValdators();
}

cheers,
mortb


"Pablo Apanasionek" <(E-Mail Removed)> wrote in message
news:uqv$(E-Mail Removed)...
> Hey, i'm getting started with ASP.NET and C# and i got into this problem:
> I have a user control that works as a header (user information, logo,
> date, etc) that has two textboxes and a button, which do the work for user
> login. This header persists through the whole webapp. The textboxes are
> validated with two required validator controls (user and password).
> On the other hand, i have a form that does the user registration (for new
> users). The problem arrives when i try to submit this form and there is no
> data on the header's textboxes: the req field validators activate and i am
> stopped there.
>
> I guess the Click event on the 2nd form is triggering validators on the
> 1st one, is there a way to make them independant?
>
> Thanks in advance
> Pablo Apanasionek
> www.dreamovate.com.ar
>
>



 
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
MasterPage, UserControl and Webform kirkski ASP .Net Web Controls 1 05-12-2007 04:43 PM
Moving value from popup Webform to main Webform? =?Utf-8?B?Vk1J?= ASP .Net 1 10-09-2006 05:15 PM
Using one webform to set a value on another webform =?Utf-8?B?bXN1aw==?= ASP .Net 1 07-12-2006 07:23 PM
no code in webform using vs.net, but in webform using notepad timmso ASP .Net 1 12-12-2003 04:30 PM
Including WebForm Image Control in a Webform Table Control titof ASP .Net 0 07-24-2003 01:01 PM



Advertisments