473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

postback and navigate question

Hi. I need to ask the user whether to save the information on a page to a
sql server when exiting or navigating away, so I am using this code when
clicking the X button. the Button8 does that when clicked so I am reusing
it:

function HandleOnClose()

{

if (event.clientY < 0)

if (confirm("OK to save changes. Cancel to exit without saving.") )
__doPostBack('Button8','')

}

The code above works fine, problem comes with the following code that I am
using when the user clicks a link to another page, code
__doPostBack('Button8','') is never executed. is there a simple work around
for what I want to do?:

function goToAnotherPage()

{

if (confirm("OK to save changes. Cancel to show Another Page without
saving.") ) __doPostBack('Button8','');

window.navigate("another_page.aspx");

}
Nov 19 '05 #1
1 1549

Hi. I need to ask the user whether to save the information on a page to a
sql server when exiting or navigating away, so I am using this code when
clicking the X button. the Button8 (an asp.net server control) does
that(save to database) when clicked so I am reusing
it in my javascript:

//this code is launched in the OnBeforeUnload event in the <body> section
function HandleOnClose()

{

if (event.clientY < 0)

if (confirm("OK to save changes. Cancel to exit without saving.") )
__doPostBack('Button8','')

}

The code above works fine, problem comes with the following code that I am
using when the user clicks a link to another page, code
__doPostBack('Button8','') is never executed. is there a simple work around
for what I want to do?:
// this code is launched when clickin in my page's links
function goToAnotherPage()

{

if (confirm("OK to save changes. Cancel to show Another Page without
saving.") ) __doPostBack('Button8','');

window.navigate("another_page.aspx");

}

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tobias[br] | last post by:
hi there people.. i starting with asp.net, and i´m trying to make a application with navigate buttons.. back and next.. for this i create a dim tb as integer and on page load i do this...
4
by: lilfos | last post by:
Hi there, I have an asp.net page with essentially a "don't forget to save" pop-up that is called when the user attempts to navigate away from the page. The user has the option to cancel and...
0
by: Alejandro Penate-Diaz | last post by:
Hi. I need to ask the user whether to save the information on a page to a sql server when exiting or navigating away, so I am using this code when clicking the X button. the Button8 (an asp.net...
0
by: campwes | last post by:
Hey there. I have a user control on an aspx page that displays data based on a query (handled by another user control also on the page). I've noticed that the first time I navigate to the page...
6
by: Terry Holland | last post by:
I have an asp page that contains a user control. This control is a panel containing a number of link buttons that get displayed if certain conditions in the db are met and these conditions can...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
2
by: TheAmes | last post by:
Hi I have a asp.net site in VB.NET and VWD 2005 Express. in the master page i have a Label. from a content page i change the value of this label like so: dim X as label =...
3
by: stephenedavis | last post by:
I keep getting the error message "Invalid postback or callback argument" on my asp.net 2.0 pages in Internet Explorer. These pages are simple, and just to make sure there is nothing wrong with the...
4
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi peeps I'm trying to change the default postback of my webpage. I'm trying to create a searchbox where you can just press enter and it goes to the search results (ala apple.com *ahem* :o) ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.