473,471 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RegisterExpandoAttribute with ajax

We've developed various custom controls that use
Page.ClientScript.RegisterExpandoAttribute. This method creates a variable
at the bottom of the page and populates its properties.

My problem is that my control is in the edit template of a grid view. When
initially viewing the page, the control isn't created so
registerexpandoattribute doesn't fire. When I click edit the grid shows the
edit template, causing the control to get created and now
RegisterExpandoAttribute fires, but because it's in the update panel, the
javascript variable and it's properties won't get rendered. How should this
be handled in a control that could be used in an update panel?

Jul 12 '07 #1
2 3229
try (air code):

public void RegisterExpando(Control ctl, string name, string value)
{
ScriptManager.RegisterClientScriptBlock(ctl,
typeof(Page),
"expando" + name,
string.Format(@"
$get('{0}').{1}='{2}';
", ctl.ClientID,name,JQuote(value)),
true);
}

// sample not complete
public string JQuote(string s)
{
s = s.Replace(@"\",@"\\");
s = s.Replace("'","\'");
s = s.Replace("\n",@"\n");
return s;
}
-- bruce (sqlwork.com)
Jeremy wrote:
We've developed various custom controls that use
Page.ClientScript.RegisterExpandoAttribute. This method creates a variable
at the bottom of the page and populates its properties.

My problem is that my control is in the edit template of a grid view. When
initially viewing the page, the control isn't created so
registerexpandoattribute doesn't fire. When I click edit the grid shows the
edit template, causing the control to get created and now
RegisterExpandoAttribute fires, but because it's in the update panel, the
javascript variable and it's properties won't get rendered. How should this
be handled in a control that could be used in an update panel?
Jul 12 '07 #2
I think ScriptManager has also RegisterExpandoAttribute method. Doesn't that
work?
http://ajax.asp.net/docs/mref/M_Syst..._fc08db2e.aspx

It should be compatible with partial page rendering.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"Jeremy" <no****@please.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
We've developed various custom controls that use
Page.ClientScript.RegisterExpandoAttribute. This method creates a
variable at the bottom of the page and populates its properties.

My problem is that my control is in the edit template of a grid view.
When initially viewing the page, the control isn't created so
registerexpandoattribute doesn't fire. When I click edit the grid shows
the edit template, causing the control to get created and now
RegisterExpandoAttribute fires, but because it's in the update panel, the
javascript variable and it's properties won't get rendered. How should
this be handled in a control that could be used in an update panel?

Jul 13 '07 #3

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

Similar topics

11
by: Yarco | last post by:
I want to use "Ajax" to create my web for hobby. But i don't know whether "Ajax" is mature... And what about with php? Someone have experience on it? ....
4
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
0
by: melledge | last post by:
Ajax Developers' Day added to XTech 2006 agenda XTech 2006 - 17-19 May - Hotel Grand Krasnopolsky - Amsterdam, The Netherlands
0
by: melledge | last post by:
Ajax Developers' Day to Kick Off XTech 2006 Conference Industry experts offer insight into next generation of the Web ALEXANDRIA, VIRGINIA, USA - April 25, 2006 - In response to the rapidly...
1
by: www.web20developers.com | last post by:
http://www.web20developers.com http://www.web20developers.com/index.php?option=com_content&task=view... Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell AJAX -...
10
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
controlsPlease could some of you here post some of your live examples of AJAX (esp drag panels, collapsable panels, and popup menu.) (It's one thing to talk about how great something is, but it's...
2
by: soni2926 | last post by:
hi, does anyone know of any good books on ajax and asp.net, one that teaches ajax itself before jumping in atlas? I wanted to get an understanding of ajax and how to use it, most books i've seen...
1
by: shaunwo | last post by:
I'm an AJAX / DOM Novice (at best) and trying to figure out how to write the value to a couple input fields. I don't remember exactly where I got the ajax.js file I'm using from (went to the website...
11
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit (using .net version 3.5) is closed before the Ajax enable controls complete loading, then IE locks up. Does it in both IE7...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.