Welcome Guest Search | Active Topics | Sign In | Register

CallBackPanel issues Options
Sanjay
Posted: Friday, April 17, 2009 12:56:42 PM
Rank: Member
Groups: Member

Joined: 8/26/2007
Posts: 12
Hi
2 issues with callback panel

1. When I added a callback panel on a page, it throws away the previous formatting for <% response.write(xxx) %> strings which are all clubbed together at the topLeft corner of the page. any idea why? once i remove the call back panel they return to nromal position in the page. i have tried adding tables, using static layout option but no avail. it is the callback panel

2. how do i update a page variable (say I declare n as integer and assign value = 1 at page load) when the callbackpanel updates the page variables stays the same. how do i update value to this variable

Thanks

sanjay
eo_support
Posted: Friday, April 17, 2009 2:09:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I do not think you can use Response.Write with CallbackPanel. CallbackPanel uses a second HtmlTextWriter to capture the rendering output so that it has a chance to examine and extract contents from the output in case it needs to. At runtime, this second HtmlTextWriter is passed to each controls' Render method. Response.Write does not occur within Render so it does not write to this writer. Other AJAX solutions such as ASP.NET UpdatePanel all have similar restrictions.

There are a number of ways to workaround this. One way is to use a Literal control, then instead of using Response.Write, you can set the Literal's Text property. Another way is to replace Response.Write with rendering syntax "<%= %>". Both should bring it back to the normal Render flow.

As to the page variables, you can take a look of view state. It has nothing to do with our CallbackPanel.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.