Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i click on the gridview paging and navigate the next page but i refresh the page getting this popup message error in IE browser.

What I have tried:

C#
protected void gvesource_PageIndexChanged(object sender, GridViewPageEventArgs e)
{
    gvesource.PageIndex = e.NewPageIndex;
    gvesource.DataBind();
    Response.Redirect(Request.RawUrl);
}

I am trying this one but not working it is a infinity looping.
Posted
Updated 11-Nov-19 7:21am
v2
Comments
F-ES Sitecore 5-Jan-17 10:20am    
If you redirect to the same page the way you are doing it will behave as if the user has come to the page for the first time so you'll lose your current page.

This behaviour is standard for browsers, not just IE, users are used to it so it's nothing to worry about. To get around it you'd need to handle all your own paging using links and the query string rather than relying on server-side events, a task that will require you to completely rewrite everything you've done.

 
Share this answer
 
Comments
Member 12935894 6-Jan-17 5:48am    
on page refreshing how to call this java script method?
Disable F5


document.onkeydown = function(e) {

if (e.keyCode === 116) {
return false;
}
};

 
Share this answer
 
Comments
Richard Deeming 12-Nov-19 11:19am    
F5 is not the only way to refresh the page.

And trying to disable browser features to avoid annoying your users will only end up annoying your users even more.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900