.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

How to warn to save before leaving a page or pagefunction?

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :WPF

I wish to implement a warning about the need to save changes before leaving a page or pagefunction.

The user is given the option to cancel the request to leave the page so that the user can perform appropriate actions before leaving the page or pagefunction.

The logic needs to cope with both

  1. navigating away from the page/pagefunction actions and
  2. clicking the "x" in the top-right to close the page/pagefunction.

How can this be implemented in a page/pagefunction wich may or may not be part of a "wizard like" sequence of pages?


View Complete Post

More Related Resource Links

How to add a new button to the newform.aspx page which says "Save and add another record" ?

Team, I have a scenario where my client wants me to add a nother button to NewForm.aspx page in addition to Save and Cancel buttons. The job of that buttom should be to save the record and open that new form again. Is this possible.If yes can you guie me how to do it though designer? Thanks in advance. Deepti.  

Refresh Parent Page List after Edit Item Modal Dialog Save/Close

I am calling the Edit Item URL (EditForm.aspx?ID=x&IsDlg=1) via javascript code to bring up the Edit Item Modal Dialog. This works fine and dandy. But what callbackfunction should I invoke after the Save so that the parent list is refreshed? Is there a better way to do it than call reload on the entire parent frame? It almost looks like there should be a way to refresh just the list. Any help appreciated. Thanks, Jake.

MS Ajax web page Save As file


I have several pages in my site that are using an UpdatePanel to allow partial postbacks to step through the process of selecting options for a dynamic report.  An internal user just came to me and said "I ran this report and then clicked 'File -> Save As .mht' to save it to my desktop, and when I opened the resulting file, it was the first selection option rather than the result.

I have verified myself that this is the case.  If this particular page has for example, 4 states: 1st option, 2nd option, 3rd option, Resulting Report..  All coming from the same page, just different panels being shown for each step.  When the user is viewing the resulting report and clicks File -> Save As, the file that is saved is of the 1st option, not the results.

I know one way around this would be to add a link to the page to "Save as PDF" or whatever, and then I'd have to write the code to generate that file...  and I can do that if I need to.  I just thought that the user should also be able to Save their current page at any point by clicking Save As.

Is this possible with MS Ajax?  Maybe this is an Ajax thing, and not a MS thing? 

Anybody know how to save the web page's current view (ie: what is currently visible)?


Save a page only when user changes any data



 I my application in need to save web page data only when user changes any loaded data?If not should promt a message

No data to save ! how to do it.Please help me

Save a publishing page using Javascript in page edit mode


Dear developers,

In a publishing site, I'd like to know the javascript functions responsible to execute the "Save" and "Save and stop editing" buttons logic within the page editing toolbar.

I've seen a poor MSDN documentation related to the Custom Actions in the Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions namespace and need a way to figure it out.

Best regards

Ahmed Abuabdou, SharePoint Developer, Sure Technology & Consulting

How to add custom field into registration page and save it to database?


Hi all,

I try to construct a membership system using Walkthrough: Creating a Web Site with Membership and User Login. The membership system is going to be added to umbraco cms. I should admit that I am still in the learning process and need your guidance for my question.

On my registration page other than standard fields which comes with CreateUserWizard, I need to add some extra fields in addition to that and those fields should be saved to database along with standard fields.

Is it possible? If it is, how can I manage to do that?



Grab a web-page from sharepoint and save to my computer?


We maintain a server-list which is business-critical for us at work. This list is at Sharepoint.

However, in case of disaster we would need a copy of this list instant available for us in an easy-to-get format. Are there any programs or scripts (any format) out there that can save a web-page to a file?

Progrmmatically Creating the Asp.net Page and save it to the root Directory


Hi all

Please tell me How i solved  probelm of dynamic creation of aspx page on fly and save it to the disk or root direcotry of the Project.

Any link or Article is highly Appericiated.


Best Regards


Save complete Web page using selenium and c#

I want to save(File->Save as) web page using asp.net.
after saving the page i should have web page and folder containing image,javascript and all other files,
how should i do this?

Page Load on leaving the page.


Hi everybody.

My Page_Load events are being called when I leave the page, so If im on Page1.aspx and I click to a link for Page2.aspx, the Page_load for Page1 is being fired. On a few of my pages I have some complex tasks being done in the Page_Load, which I dont need to be done when leaving the page.

Is there a way that I can capture the fact that I'm leaving the page? I would have thought that getting the request object at this point would show tht I had requested Page2 but it doesnt. It shows Page1.aspx.

Thanks for your help!


Move a wiki library? (Save wiki as template/download wiki page)


Hi all,

I'm using SharePoint Foundation and there is no option to save a wiki library as a template, and the Download a copy control is disabled for the wiki pages. Is this normal? Is there anyway to save a wiki as a template?

Or, is there a different way to move an entire wiki library to a new site collection? The old, easy way was save it as a template and use that template in another site. Am I missing something?

Thanks for your time.

Need to save unique state for each PAGE (losing current filters)



Nutshell: App has the ability to show same page with different settings at the same time, and the session state is too broad for that. I need to have a set of states, one for each page. 

My web page can display a scorecard that allows user to view or change scores for one or more possible sports teams (I changed actual business requirements to keep problem simple). For example, Team 1 can have positive score for some aspects of a game and negative for other aspects of a game. This page can show one or more teams side by side for comparison. The ability to add teams to the view is called filtering. There can be more than one view in a browser's tabs or new windows.

Here are my problems:

1. If the user presses Browser Refresh, they lose all current filters unless I use Session or TempData. Using Form Post does not work here. 

2. However, solution 1 doesn't work for multiple pages where the user wants to bring up 2 different views of the same page (for example, page 1 has Teams 1 and 2, and Page 2 has Teams 3 and 4). They cannot do this using Session or TempData. This only works if I pass the current filters to the controller via a Post Form Data data or in the Url.

3. The use of a url won't work because the data that needs to pass to the controller sometimes exceeds 500 characters.

I have googled this to no

'The page took too long to save...' error and IE8

Hi people,

I have installed Intenet Explorer 8 and started experience a problem. When my publishing page is in Edit mode and I click any link to navigate out to a different page IE8 prints 'Saving Page Content...' in its status bar for about 20 seconds and then displays a message box 'The page took too long to save...'. There were no such error with either IE7 or FireFox. After playing with Javascript debugging, I found that SBN_CallBackHandler() client function of SaveBeforeNavigationControl is not called as it supposed to. It looks like the implementation of XMLHttpRequest object in IE8 is somehow different from the previous release. I'm not sure if it is a bug of IE8 or SharePoint javascript but the problem exists. Fortunatelly, IE8 allows you to turn off its advanced setting 'Enable native XMLHTTP support' (enabled by default) in menu Tools/Internet Options/Advanced. It solves the problem but I would like to have more correct solution :-)  Any ideas?

Rich Text editor comes up with random error The Page took too long to save. You can click "Cancel",

I seem to get a random error when i open the rich text editor in a content editor web part and try to save the changes.

The error i get is:
Are you sure you want to navigate away from this page?
The page took too long to save. You can click "Cancel", and then try to save the page again. If you click "OK", you might lose unsaved data.
Press OK to continue, or Cancel to stay on the current page.

If i click OK it seems to save the changes but this problem is very annoying and users are obviously worried when they see this error.
Does anyone have any ideas what is causeing this error across the entire site? and are there any fixes?

thanks for your time,

Tony Phillips

Getting 'The page took too long to save' message.

Hi there.

I'm using a SharePoint site that all of a sudden is now throwing 'The page took too long to save' messages when I try ot save an ASPX page in the edit mode. This was not happening yesterday.

I understand that this could be due to a number of other elements, but has anyone else experienced this issue and found that it was something particular at fault?

Also I have been getting the message 'Please wait while script are loading...' appearin the status bar for IE. There's no reason why the page should take so long to render, but again if anyone else has a suggestion as to why this is occurring, then any help would be appreciated.

Save DataGrid row changes when leaving row


I am using .NET 4 with WPF and the Entity Framwork. I want to have editable rows in a DataGrid representing EF Entities that are saved automatically to the database when the user jumps to another row (standard behavior, like the old Access tables ;-).

The RowEditEnding event handler of the Datagrid is nicely called when the focus leaves the row - exactly what I want. But inside the RowEditEnding handler the new values in the row are not yet assigned to the underlying Entity so calling EF's dataContext.SaveChanges() is useless at this point. Have I missed another event handler which is called after the values have been transfered to my business object? Or is there another good solution for calling SaveChanges() after the user has left a row?

Thanks for your hints.

Please note: I know about DataGrid's awareness of the IEditableObject, but would would like to avoid it. EF's entity classes inherit from EntityObject which does not implement IEditableObject. As Entities already inherit from some class I can not inherit from a generic IEditableObject implementation and would have to manually add that to all my entity classes. Also: except for "bad timing" mentinoned above the DataGrid already does 95% of what I want.

Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend