Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Ken #1
usercontrol and clientside validation
Hi there,
I have a usercontrol and i have written sone clientside
validation script associated along with it. Now when i
register this usercontrol in the mainwebform, how can i
access the clientside validation to validate the
usercontrol?
Thanks in advance
-K
Ken Guest
-
Event not firing in usercontrol inside usercontrol
I'm stumped on this problem. I've created a user control that dynamically creates 5 linkbuttons in the CreateChildControls method. Each of these... -
Datagrid and clientside callback events
Hi All, I've been looking at clientside callbacks as a way to update parts of a page without a postback. Is there a way of rebinding a... -
DatGrid TemplateColumn TextBox JavaScript ClientSide Validation?
Hi, I am using 2 TemplateColumn TextBoxs in my Grid. On the Submit button click event I want to do the validation on the client side. In the... -
clientside events
I want to validate client entries into textbox,checkbox controls etc. can u do this with asp. Like, is there onchange and onclick and so on for... -
Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack
a uscontrol test.ascx have a dropdownlist web control the dropdownlist's AutoPostBack property is set "true" but when i use... -
Peter Blum #2
Re: usercontrol and clientside validation
Can you clarify what you mean by "validate the user control"? Are you
creating a control subclassed from System.Web.UI.WebControls.BaseValidator?
--- Peter Blum
[url]www.PeterBlum.com[/url]
Email: [email]PLBlum@PeterBlum.com[/email]
"Ken" <anonymous@discussions.microsoft.com> wrote in message
news:01c101c3d6de$8fe773e0$a301280a@phx.gbl...> Hi there,
> I have a usercontrol and i have written sone clientside
> validation script associated along with it. Now when i
> register this usercontrol in the mainwebform, how can i
> access the clientside validation to validate the
> usercontrol?
>
> Thanks in advance
>
> -K
Peter Blum Guest
-
psb #3
Re: usercontrol and clientside validation
if i know I will never add any more controls to the page I will let the page
render. then I will look at the source. your elements will have id's like
"_ctl45_txbZipCode" or "_ctl45_txbName". I would then use these as the name
to validate against...
if (document.Form1['_ctl45_txbName'].value.length == 0) return false;
**NOTE: if you add controls to the page the "ctl45" may change to "ctl46"
and so on. so when updateing the page, make sure the javascript validation
code works.
whatever. sorry if this is not what you are talking about....
-psb
"Ken" <anonymous@discussions.microsoft.com> wrote in message
news:01c101c3d6de$8fe773e0$a301280a@phx.gbl...> Hi there,
> I have a usercontrol and i have written sone clientside
> validation script associated along with it. Now when i
> register this usercontrol in the mainwebform, how can i
> access the clientside validation to validate the
> usercontrol?
>
> Thanks in advance
>
> -K
psb Guest
-
romash80 #4
Re: usercontrol and clientside validation
What you can do is define the validator in the page outside the user control and set its property to validate the controls inside the user control: ControlToValidate=”UserControlID1$TextBox1″
Refer to the blog:
http://geekash.wordpress.com/2011/01/30/client-side-validation-of-a-control-defined-inside-a-web-user-control-in-asp-net/
Junior Member
- Join Date
- Feb 2011
- Posts
- 3
-
romash80 #5
Re: usercontrol and clientside validation
You can use the format ControlToValidate="UserControlID$ControlID". This works with ValidationGroup property as well.
Refere to:
http://ashgeek.blogspot.com/2011/01/client-side-validation-of-control.html
Junior Member
- Join Date
- Feb 2011
- Posts
- 3
-
romash80 #6
Re: usercontrol and clientside validation
You can use the format ControlToValidate="UserControlID$ControlID". This works with ValidationGroup property as well.
Refere to:
http://ashgeek.blogspot.com/2011/01/client-side-validation-of-control.html
Junior Member
- Join Date
- Feb 2011
- Posts
- 3



Reply With Quote

