Showing posts with label ideas. Show all posts
Showing posts with label ideas. Show all posts

Wednesday, March 28, 2012

change scroll position on partial-page update?

I'm wanting to be able to change the scroll position to the bottom (or to an anchor) on an AJAX partial-page update. Any ideas? Can I fire a client-side javascript function after the update? Do I have to turn off MaintainScrollPositionOnPostback for the page?

Seehttp://forums.asp.net/t/1157991.aspx

Also, if you have specific scrolling logic when the UpdatePanel comes back, you can add it to EndRequest method in the following code (e.g. scrollTo)...

<script language="javascript" type="text/javascript"> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(InitializeRequest); prm.add_endRequest(EndRequest); function InitializeRequest(sender, args) { ... } function EndRequest(sender, args) { ... } </script>

-Damien


Thanks... that's what I needed!

Brad


http://aspnet.4guysfromrolla.com/articles/111704-1.aspx

<pages smartNavigation="true"MaintainScrollPositionOnPostback="true"/>

Try this also

<script type="text/javascript"
var prm = Sys.WebForms.PageRequestManager.getInstance();

prm.add_beginRequest(beginRequest);

function beginRequest()
{
prm._scrollPosition = null;
}

</script>

Lety me know if this helpful to you

Monday, March 26, 2012

Challenging PageRequestManagerParserException error

Hello,

I received the following error today (using ASP.NET AJAX), and I'm unable to suss it out. Any ideas on what might be causing the below?:

Sys.WebForms.PageRequestManagerParserException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to response.write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near 'Master 544|updatePan'.

I believe I am using the latest version of System.Web.Extensions, Version=1.0.61025.0

Thanks in advance,
-Alex

Hi, I figured it out. There was a Response.Write() call in the aspx page (inline in the HTML). Apparently, this is not allowed when using UpdatePanels. Any more info available on this subject?

-Alex


Thanks for the info ... I didn't figure it was my update panel who cause my trouble ...

I use another way to do it. Thanks !