Monday, March 26, 2012

Atlas update panel problem

Hi,

I have page which main content is generated with function which returns HTML string:

<table>
<

tbody><tr><tdvalign="top"align="left">
<%=_contentOfPage%>
</td></tr></tbody>
</table>

Ant the function in code behind looks like:

public

string _contentOfPage;
publicvoid getContent(Int32 nDays)

{

String content;

content=.....//here is logic, which define content of the page

.......

_contentOfPage=content;

}

Everything works fine.

Because page has a lot of menues which I don't wont to refresh on every page submit, I included atlas update panel, which refresh only the main content of the page. It works with atlas too, page doesn't blink and only the main content is refreshed on page submit, like I wanted. But the interesting here is that refreshing only the part of the page(main content) takes about 3 seconds, while on the other hand, refreshing whole page takes only 1 second.
On all other pages, refreshing only content of the page works much faster, but here not. Any idea why?
Maybe because the length of _contentOfPage string is about 10000 signs or more?

Regards,S

HI,
as per my guess you are using lots of string concatenations to create the _contentOfPage,
that will take much of the server time,
try using stringBuilder which will be quite faster than the normal string concatenation

hope this will help
satish

Hi,

all I'm using for string concate is + sign between many if statements.
Maybe string builder is faster but the problem is not on the server.

The function on the server generates string in miliseconds.

The problem is obviously on client side.

Atlas call this method from client to server with ajay technology(XML HTTP) and than replace part of page on client with new string which gets from the server.(I think with INNERHTML method or similar).

If string is very long, like in my case, that procedure is slower than refresh a whole page.

I don't know if that is a rule or I missed something? Any idea?

regards,S

No comments:

Post a Comment