473,804 Members | 3,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ScriptManager.R egisterClientSc riptBlock not working with UpdatePanel

I have a dynamically created page. The page creates an UpdatePanel
(created at Design time) which has an ASP:Table (design time) in it.
The table has rows with a textbox (run time) that runs some Javascript
code when it is typed in.
There is also a linkbutton (run time) next to this textbox that when
clicked uses Ajax to reload the Javascript method.
However, the Javascript is not being updated.

I realize that most people post this question and the answer is "Use
ScriptManager instead of Page.ClientScri pt" bu tthe problem is that
I'm already using ScriptManager.

Here is my line of code:
ScriptManager.R egisterClientSc riptBlock(updpn lHolder,
typeof(UpdatePa nel), "AddOnLife" , code, true);

I've tried registering it to the UpdatePanel, to the Page, to the
ASP:Table inside the Panel, even to the Textbox. The Textbox is the
only one that errors (saying the control must be in the Page control
tree) but the rest of them go through without erroring...but they
don't actually update the Javascript.

Anyone have any ideas?
Sep 11 '08 #1
5 13662
Hi Pselus,

How do you create the page and the update panel with the table dynamicaly,
while having them in design time? The statement seems fine to me...

Cheers,
Erjan

"Pselus" <ja****@gmail.c omwrote in message
news:91******** *************** ***********@l64 g2000hse.google groups.com...
>I have a dynamically created page. The page creates an UpdatePanel
(created at Design time) which has an ASP:Table (design time) in it.
The table has rows with a textbox (run time) that runs some Javascript
code when it is typed in.
There is also a linkbutton (run time) next to this textbox that when
clicked uses Ajax to reload the Javascript method.
However, the Javascript is not being updated.

I realize that most people post this question and the answer is "Use
ScriptManager instead of Page.ClientScri pt" bu tthe problem is that
I'm already using ScriptManager.

Here is my line of code:
ScriptManager.R egisterClientSc riptBlock(updpn lHolder,
typeof(UpdatePa nel), "AddOnLife" , code, true);

I've tried registering it to the UpdatePanel, to the Page, to the
ASP:Table inside the Panel, even to the Textbox. The Textbox is the
only one that errors (saying the control must be in the Page control
tree) but the rest of them go through without erroring...but they
don't actually update the Javascript.

Anyone have any ideas?
Sep 11 '08 #2
how do you know its not added? this stuff is easier to debug with
firefox and its dev tools (firebug and dev tool). you can see added
script and dom changes done by ajax calls.

-- bruce (sqlwork.com)

Pselus wrote:
I have a dynamically created page. The page creates an UpdatePanel
(created at Design time) which has an ASP:Table (design time) in it.
The table has rows with a textbox (run time) that runs some Javascript
code when it is typed in.
There is also a linkbutton (run time) next to this textbox that when
clicked uses Ajax to reload the Javascript method.
However, the Javascript is not being updated.

I realize that most people post this question and the answer is "Use
ScriptManager instead of Page.ClientScri pt" bu tthe problem is that
I'm already using ScriptManager.

Here is my line of code:
ScriptManager.R egisterClientSc riptBlock(updpn lHolder,
typeof(UpdatePa nel), "AddOnLife" , code, true);

I've tried registering it to the UpdatePanel, to the Page, to the
ASP:Table inside the Panel, even to the Textbox. The Textbox is the
only one that errors (saying the control must be in the Page control
tree) but the rest of them go through without erroring...but they
don't actually update the Javascript.

Anyone have any ideas?
Sep 12 '08 #3
On Sep 11, 3:14*pm, "Erjan Gavalji" <erjob...@yahoo .comwrote:
Hi Pselus,

How do you create the page and the update panel with the table dynamicaly,
while having them in design time? The statement seems fine to me...

Cheers,
Erjan

"Pselus" <jam...@gmail.c omwrote in message

news:91******** *************** ***********@l64 g2000hse.google groups.com...
I have a dynamically created page. *The page creates an UpdatePanel
(created at Design time) which has an ASP:Table (design time) in it.
The table has rows with a textbox (run time) that runs some Javascript
code when it is typed in.
There is also a linkbutton (run time) next to this textbox that when
clicked uses Ajax to reload the Javascript method.
However, the Javascript is not being updated.
I realize that most people post this question and the answer is "Use
ScriptManager instead of Page.ClientScri pt" bu tthe problem is that
I'm already using ScriptManager.
Here is my line of code:
ScriptManager.R egisterClientSc riptBlock(updpn lHolder,
typeof(UpdatePa nel), "AddOnLife" , code, true);
I've tried registering it to the UpdatePanel, to the Page, to the
ASP:Table inside the Panel, even to the Textbox. *The Textbox is the
only one that errors (saying the control must be in the Page control
tree) but the rest of them go through without erroring...but they
don't actually update the Javascript.
Anyone have any ideas?
The updatepanel and table are created at design time but the table is
populated with controls at run time.
Sep 12 '08 #4
On Sep 11, 11:46*pm, bruce barker <nos...@nospam. comwrote:
how do you know its not added? this stuff is easier to debug with
firefox and its dev tools (firebug and dev tool). you can see added
script and dom changes done by ajax calls.

-- bruce (sqlwork.com)

Pselus wrote:
I have a dynamically created page. *The page creates an UpdatePanel
(created at Design time) which has an ASP:Table (design time) in it.
The table has rows with a textbox (run time) that runs some Javascript
code when it is typed in.
There is also a linkbutton (run time) next to this textbox that when
clicked uses Ajax to reload the Javascript method.
However, the Javascript is not being updated.
I realize that most people post this question and the answer is "Use
ScriptManager instead of Page.ClientScri pt" bu tthe problem is that
I'm already using ScriptManager.
Here is my line of code:
ScriptManager.R egisterClientSc riptBlock(updpn lHolder,
typeof(UpdatePa nel), "AddOnLife" , code, true);
I've tried registering it to the UpdatePanel, to the Page, to the
ASP:Table inside the Panel, even to the Textbox. *The Textbox is the
only one that errors (saying the control must be in the Page control
tree) but the rest of them go through without erroring...but they
don't actually update the Javascript.
Anyone have any ideas?
I know that it hasn't changed because I can see the Javascript method
when I view the page source. It is still the same in the page source
and the outcome is still the same.
Sep 12 '08 #5
On Sep 11, 2:37*pm, Pselus <jam...@gmail.c omwrote:
I have a dynamically created page. *The page creates an UpdatePanel
(created at Design time) which has an ASP:Table (design time) in it.
The table has rows with a textbox (run time) that runs some Javascript
code when it is typed in.
There is also a linkbutton (run time) next to this textbox that when
clicked uses Ajax to reload the Javascript method.
However, the Javascript is not being updated.

I realize that most people post this question and the answer is "Use
ScriptManager instead of Page.ClientScri pt" bu tthe problem is that
I'm already using ScriptManager.

Here is my line of code:
ScriptManager.R egisterClientSc riptBlock(updpn lHolder,
typeof(UpdatePa nel), "AddOnLife" , code, true);

I've tried registering it to the UpdatePanel, to the Page, to the
ASP:Table inside the Panel, even to the Textbox. *The Textbox is the
only one that errors (saying the control must be in the Page control
tree) but the rest of them go through without erroring...but they
don't actually update the Javascript.

Anyone have any ideas?
I think I figured it out.
The Javascript code was being registered twice on a postback (or on an
Ajax postback). It was being registered like normal, then it went
through the code to change the Javascript code and registered it
again. The second registration wasn't being recognized.
I put a check around the first registration to check the control
causing the Postback and if it was the link that was supposed to
create the new Javascript I made sure not to register it the first
time.
Works perfectly now.
:)
Sep 12 '08 #6

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

Similar topics

6
5725
by: MSDN | last post by:
After a postback, how do I set focus onto a control that is inside an updatepanel?
2
15076
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have been able to find the cause of the problem, and will describe it here first textually and then through a code example. The purpose of what I am trying to do is to create a postback-free web application through the use of ASP.net AJAX UpdatePanels...
3
8212
by: JacekDr | last post by:
Hello, I've got the following problem: I want to add and remove dynamically controls to UpdatePanel. In my user control I have a button, but when I click it I get AsyncPostback and Event for ButtonClick in UserControl doesn't fire. <asp:ScriptManager ID="ScriptManager" EnableViewState="true" runat="server" EnablePageMethods="True" >
0
1102
malav123
by: malav123 | last post by:
Hi, I am using ajax toolkit and in project i am using tabcontainer... but script manager not working in my aspx page and without script manager tab container can not be used... I am getting error like "Unknown server tag:Script Manager"... so please give me solution for given problem.... I am awaiting for your reply... thanks in advance....
5
12610
by: Leon Mayne | last post by:
Having a bit of trouble here. I know that if you want to use a fileupload control inside an AJAX update panel then you need to create a trigger for the control that performs the uploading postback to the updatepanel, but the problem is, I have an update panel inside a web usercontrol, and the usercontrol is sitting inside an updatepanel on the host page. I therefore can't add a trigger to the control directly, as the host page has no access...
1
2060
by: Mark B | last post by:
This is my first try at using AJAX. I want the calendars to be enabled if the user checks CheckBox1. It works OK for a normal all page refresh but once I introduced the AJAX code it stopped working. Any ideas? <%@ Page Language="VB" AutoEventWireup="false" CodeFile="default-ajax.aspx.vb" Inherits="pages_verify_groups_Default" Debug="true" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
3835
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to DropDownList1 using the ScriptManager SetFocus method. Use the Visual Studio debugger. Set a breakpoint on in the (!IsPostBack) part of the PageLoad method. Start the web application and continue after the breakpoint has been reached.
2
12286
by: qwedster | last post by:
Folks! The following is a "Hello World" kind of code for ViewState. I just want to know how to retain the ViewState 1) while Page Refresh when using UpdatePanel and also 2) While I reverting back to the page after round trip when using UpdatePanel? In the following code snippet the ViewState is killed when I click page refresh or when I go some page and revert back Code Snippet: // Default.aspx:
0
1028
by: nira alex | last post by:
Hi, I have an ASP.net page with a repeater and other control. I wrote the following: ScriptManager.RegisterClientScriptBlock(this, GetType(), "test", "confirm(\"Are you sure you want to proceed?\")", true); and called it in code behind on repeater item command. If the user clicks the rows on the repater then i have to display a confirmation message.
0
9705
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9575
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10564
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6846
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.