Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Martin #1
RegisterClientScriptBlock with rendered control?
Hi,
Are there any issues using ClientScriptManager.RegisterClientScriptBlock in
a rendered control?
I'm calling this function within the overriden Render method of my
WebControl, but nothing the script is not coming out in my page source.
After calling RegisterClientScriptBlock, a call to
IsClientScriptBlockRegistered confirms the script block is registered.
Any ideas?
Thanks
Marti
Martin Guest
-
RegisterClientScriptBlock does not work from a server control
For some reason I cannot get RegisterClientScriptBlock to render a script reference on the page from a server control. Yes, I have not placed the... -
Repeater control in a rendered custom control
I have created a custom control that puts a html wrapper around some code so <myc:cPanel ...>more html</myc:cPanel> will draw a html table which... -
ControlDesigner not invoked on custom control when control is rendered within another custom control
I have a custom control that has a simple designer (derived from System.Web.UI.Design.ControlDesigner) associated with it (using the... -
control equivalent to Page.RegisterClientScriptBlock?
I have a user control that can be created from a variety of other user controls. It is the same no matter where it is created from, and I only... -
problem with name created when control is rendered.
Hello, I am creating a html server control that is in a datalist. I need to access this controls value on the client via javascript but the name... -
Teemu Keiski #2
Re: RegisterClientScriptBlock with rendered control?
Using these in render method is too late since form has already begun
rendering (scrips to be rendered are sort of fixed at that point already).
Do registration in OnPreRender/PreRender stage.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
[url]http://blogs.aspadvice.com/joteke[/url]
"Martin" <x@y.z> wrote in message
news:emcAPlDzGHA.5048@TK2MSFTNGP05.phx.gbl...> Hi,
>
> Are there any issues using ClientScriptManager.RegisterClientScriptBlock
> in a rendered control?
>
> I'm calling this function within the overriden Render method of my
> WebControl, but nothing the script is not coming out in my page source.
> After calling RegisterClientScriptBlock, a call to
> IsClientScriptBlockRegistered confirms the script block is registered.
>
> Any ideas?
>
> Thanks
> Marti
>
>
>
Teemu Keiski Guest
-
Martin #3
Re: RegisterClientScriptBlock with rendered control?
Thanks Teemu
"Teemu Keiski" <joteke@aspalliance.com> wrote in message
news:%23OmsNTFzGHA.4368@TK2MSFTNGP02.phx.gbl...> Using these in render method is too late since form has already begun
> rendering (scrips to be rendered are sort of fixed at that point already).
> Do registration in OnPreRender/PreRender stage.
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> [url]http://blogs.aspadvice.com/joteke[/url]
>
>
> "Martin" <x@y.z> wrote in message
> news:emcAPlDzGHA.5048@TK2MSFTNGP05.phx.gbl...>>> Hi,
>>
>> Are there any issues using ClientScriptManager.RegisterClientScriptBlock
>> in a rendered control?
>>
>> I'm calling this function within the overriden Render method of my
>> WebControl, but nothing the script is not coming out in my page source.
>> After calling RegisterClientScriptBlock, a call to
>> IsClientScriptBlockRegistered confirms the script block is registered.
>>
>> Any ideas?
>>
>> Thanks
>> Marti
>>
>>
>>
>
Martin Guest
-
msnews #4
Re: RegisterClientScriptBlock with rendered control?
Are you expecting to see something no the web page or just in the HTML
source?
Normally this will place a script reference in your code which you cannot
see. Try placing a Javascript alert into the script to see if that is
fired.
Brennan Stehling
[url]http://brennan.offwhite.net/blog/[/url]
"Martin" <x@y.z> wrote in message
news:emcAPlDzGHA.5048@TK2MSFTNGP05.phx.gbl...> Hi,
>
> Are there any issues using ClientScriptManager.RegisterClientScriptBlock
> in a rendered control?
>
> I'm calling this function within the overriden Render method of my
> WebControl, but nothing the script is not coming out in my page source.
> After calling RegisterClientScriptBlock, a call to
> IsClientScriptBlockRegistered confirms the script block is registered.
>
> Any ideas?
>
> Thanks
> Marti
>
>
>
msnews Guest



Reply With Quote

