473,408 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to RegisterClientScriptBlock in customwebcontrol

hi,

how can i register a clientscriptblock in the page where my customwebcontrol
has been placed?
i tried
Page.ClientScript.RegisterClientScriptBlock(this.G etType(), "myscript",
script, true);

placed in the

protected override void Render(HtmlTextWriter writer)

Method.

But it doesn't work.

Thanks for help.
Mar 21 '06 #1
2 1195
DWS
Alexander,

I'm registering script in the createchildcontrols method. page_load works
great too.

Good Luck
DWS

"Alexander Widera" wrote:
hi,

how can i register a clientscriptblock in the page where my customwebcontrol
has been placed?
i tried
Page.ClientScript.RegisterClientScriptBlock(this.G etType(), "myscript",
script, true);

placed in the

protected override void Render(HtmlTextWriter writer)

Method.

But it doesn't work.

Thanks for help.

Mar 21 '06 #2
thanks a lot ... now it works (in createchildcontrols)

"DWS" <DW*@discussions.microsoft.com> schrieb im Newsbeitrag
news:F9**********************************@microsof t.com...
Alexander,

I'm registering script in the createchildcontrols method. page_load works
great too.

Good Luck
DWS

"Alexander Widera" wrote:
hi,

how can i register a clientscriptblock in the page where my
customwebcontrol
has been placed?
i tried
Page.ClientScript.RegisterClientScriptBlock(this.G etType(), "myscript",
script, true);

placed in the

protected override void Render(HtmlTextWriter writer)

Method.

But it doesn't work.

Thanks for help.

Mar 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Earl Teigrob | last post by:
I have a Web Custom Control that builds javascript to write to the page. The DatePickerJs() function builds over 500 lines of javacript code. Even thought my Custom Web Control does not write it to...
6
by: Rajan | last post by:
I have used RegisterClientScriptBlock in my ASP.NET page. it works well. Here I have problem. When Postback occurs, I dont want the script to be emitted. But It emits the Script even if I dont call...
2
by: sam | last post by:
I am trying to emit script to the response stream within the Application_Error handler in global.asax. I want to emit using Page.RegisterClientScriptBlock. This doesn't work, and I have been...
1
by: Simon Harris | last post by:
Hi All, I'm trying to write a composite web control which will render a rich text editor. I am having problems with RegisterClientScriptBlock - The script simply doesnt get written. There are...
1
by: Jason Chan | last post by:
in asp.net 2.0, Page.RegisterClientScriptBlock is replaced by Client.RegisterClientScriptBlock function signature: Client.RegisterClientScriptBlock(Type, String, String) what should i put...
2
by: kewl | last post by:
Hi All, We have an ASP.NET 2.0 (C#) intranet application that needs to spawn multiple browsers using RegisterClientScriptBlock. Here's what we got so far: // Go thru each datarow in the...
9
by: Nathan Sokalski | last post by:
I have used the RegisterClientScriptBlock method in external functions of mine (ones that are saved in a separate *.vb file), where I use them as follows: Public Shared Sub MyFunction(ByVal...
4
by: Nathan Sokalski | last post by:
I am working on converting my code from ASP.NET 1.1 to ASP.NET 2.0. In ASP.NET 1.1 the RegisterClientScriptBlock method was just a key and script (2 Strings), but in ASP.NET the...
3
by: | last post by:
Hello, I try to open a new Window in code behind with : ClientScript.RegisterClientScriptBlock(this.GetType(), "MyOpenScript", "window.open('toto.doc');", true); My problem is that the new...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.