I'm encountering an issue on my One page website with different sections. The second section includes a grid view that allows inline editing.
Problem: Whenever the OnClick method is triggered, it causes a postback and the page automatically scrolls up to the first section.
To try and fix this, I attempted redirecting like so:
Response.Redirect("Home.aspx#section2");
Although this successfully redirects, it resets the gridview edit template back to the item template. It seems like the gridview gets rebound in this process.
I also experimented with a JavaScript solution from here, but encountered the same issue.
<asp:Button ID="Edit" runat="server" Text="Edit" OnClick="Edit_OnClick"
OnClientClick="document.location.href+='#section2';return false;"></asp:Button>
Furthermore, I tried using the postbackurl attribute of a link button, only to face the same unwanted outcome.
If you have any suggestions or ideas on how to tackle this problem effectively, please share your insights! I simply need to navigate to section 2 without the page refreshing or redirecting. Thank you for your assistance in advance! :)