|
|
|
start date: Fri, 03 Aug 2007 08:11:26 -0700,
posted on: microsoft.public.dotnet.framework.aspnet.webcontrols
back
| Thread Index |
|
1
unknown
|
|
2
Teemu Keiski
|
|
3
Teemu Keiski
|
|
4
unknown
|
Can I change custom validators event?
I have developed a custom validator for checkboxes and checkbox list
required validation.
The problem I am having is that I cannot figure out how to change the
event that fires this validator. I want it to be the onclick, but
instead it seems to do it on the onblur.
Would I need to modify the Hookup scripts, or is there an easier way
to do it?
Any response would be greatly appreciated!
Thanks
Date:Fri, 03 Aug 2007 08:11:26 -0700
Author:
|
Re: Can I change custom validators event?
You need to attach it in the rendering of the CheckBoxList which in practise
mostly means custom control derived from CheckBoxList. Basically you need
PoistBackOptions class instance, passing it the reference to the CBL and
setting PerformValidation and ValidationGroup properties respectively. Then
get the script by passing PostBackOptions instance to
Page.ClientScript.GetPostBackEventReference. After that you have the script
which you'd need to attach to the onclick. You certainly could do that on
the Page to avoid custom control but that means some "glue" code on every
page, the things is used on.
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
wrote in message
news:1186153886.027147.237030@i13g2000prf.googlegroups.com...
>I have developed a custom validator for checkboxes and checkbox list
> required validation.
>
> The problem I am having is that I cannot figure out how to change the
> event that fires this validator. I want it to be the onclick, but
> instead it seems to do it on the onblur.
>
> Would I need to modify the Hookup scripts, or is there an easier way
> to do it?
>
> Any response would be greatly appreciated!
>
> Thanks
>
Date:Sun, 5 Aug 2007 10:15:47 +0300
Author:
|
Re: Can I change custom validators event?
On Aug 5, 2:15 am, "Teemu Keiski" wrote:
> You need to attach it in the rendering of the CheckBoxList which in practise
> mostly means custom control derived from CheckBoxList. Basically you need
> PoistBackOptions class instance, passing it the reference to the CBL and
> setting PerformValidation and ValidationGroup properties respectively. Then
> get the script by passing PostBackOptions instance to
> Page.ClientScript.GetPostBackEventReference. After that you have the script
> which you'd need to attach to the onclick. You certainly could do that on
> the Page to avoid custom control but that means some "glue" code on every
> page, the things is used on.
>
> --
> Teemu Keiski
> AspInsider, ASP.NET MVPhttp://blogs.aspadvice.com/jotekehttp://teemukeiski.net
>
> wrote in message
>
> news:1186153886.027147.237030@i13g2000prf.googlegroups.com...
>
> >I have developed a customvalidatorfor checkboxes and checkbox list
> > required validation.
>
> > The problem I am having is that I cannot figure out how to change the
> >eventthat fires thisvalidator. I want it to be the onclick, but
> > instead it seems to do it on the onblur.
>
> > Would I need to modify the Hookup scripts, or is there an easier way
> > to do it?
>
> > Any response would be greatly appreciated!
>
> > Thanks
Thanks Teemu,
Do you have any examples of any of this?
Jonas
Date:Sat, 11 Aug 2007 18:45:22 -0000
Author:
|
Re: Can I change custom validators event?
I have some of the idea implemented into my sample how to cause a poostback
on main poage from a popup
http://aspadvice.com/blogs/joteke/archive/2005/06/15/2340.aspx
It utilizes the idea by generating the script call to Emulate as if the
Button would be clicked while the popup is closed. Difference to your
situation is that you need to set the properties of PostBAckOptions I
mentioned, in order to make it call validation functions at client-side
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
wrote in message
news:1186857922.371811.173540@q3g2000prf.googlegroups.com...
> On Aug 5, 2:15 am, "Teemu Keiski" wrote:
>> You need to attach it in the rendering of the CheckBoxList which in
>> practise
>> mostly means custom control derived from CheckBoxList. Basically you need
>> PoistBackOptions class instance, passing it the reference to the CBL and
>> setting PerformValidation and ValidationGroup properties respectively.
>> Then
>> get the script by passing PostBackOptions instance to
>> Page.ClientScript.GetPostBackEventReference. After that you have the
>> script
>> which you'd need to attach to the onclick. You certainly could do that on
>> the Page to avoid custom control but that means some "glue" code on every
>> page, the things is used on.
>>
>> --
>> Teemu Keiski
>> AspInsider, ASP.NET
>> MVPhttp://blogs.aspadvice.com/jotekehttp://teemukeiski.net
>>
>> wrote in message
>>
>> news:1186153886.027147.237030@i13g2000prf.googlegroups.com...
>>
>> >I have developed a customvalidatorfor checkboxes and checkbox list
>> > required validation.
>>
>> > The problem I am having is that I cannot figure out how to change the
>> >eventthat fires thisvalidator. I want it to be the onclick, but
>> > instead it seems to do it on the onblur.
>>
>> > Would I need to modify the Hookup scripts, or is there an easier way
>> > to do it?
>>
>> > Any response would be greatly appreciated!
>>
>> > Thanks
>
> Thanks Teemu,
>
> Do you have any examples of any of this?
>
> Jonas
>
Date:Mon, 13 Aug 2007 21:57:20 +0300
Author:
|
|
|