Submit change before user navigate to another page

Hi Aspose Team!

I'm doing some standard data binding with the gridWeb.

My users complaint that they often forget to push the sumbit button before navigating to another page.
Thus loosing their changes.

How can I prevent this?
Is there any way to force changes to be submit before navigating to another page?

Hi,

You mean you want to submit data or save your data to your data source when you click on sheet tab to navigate to other worksheet page. Well, you may utilize SheetTableClick event handler and write your SubmitCommand or SaveCommand GridWeb's events code there. And also please make sure that SessionMode (property) of the GridWeb control should be set to Session.

If you want to have some other means like you have a Asp.Net command button, you may write your code there in its Click event and write a line of code in the PageLoad event handler

i.e.,

Button1.Attributes["onclick"] = "GridWeb1.updateData(); return GridWeb1.validateAll();";

Thank you.

Hi,
Thanks for your support.
By navigating, I meant navigating to another web page (ex: living the grid page, to use google).
How can I show a leaving page confirmation pop-up, like “do you want to submit before leaving?” in this case?

Hi,

You may use some events to detect the grid data changing, page navigation and determine whether to go on the page navigation. And I've built a sample for you.

<%@ Register TagPrefix="agw" Namespace="Aspose.Grid.Web" Assembly="Aspose.Grid.Web" %>
<%@ Page language="c#" Codebehind="ZTestFile.aspx.cs" AutoEventWireup="false" Inherits="Aspose.Grid.Web.Test.ZTestFile" %>



ZTestFile



http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">











Thank you very much.
It is exactly what I needed.
You are a life saver.