Click here to Skip to main content
15,903,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i am beginner C# programmer and i need help with a project i am doing. I have a editable gridview with a total balanced amount in the footer. The user must not be able to navigate to away from the current page until the balance amount in the footer is zero. How can i achieve this?...thanks in advance.
Posted
Comments
Sanjay Kunjam 6-Jul-12 9:18am    
In your code how many ways user can navigate away to other page means on button click or on Link Button click or what??
Ruwaldo 6-Jul-12 9:32am    
The user can close the page or click on link buttons or click one of the menu options at the top of the page or enter different url address. They shouldnt be able to do any of these if the balance amount isnt 0.
Arunprasath Natarajan 6-Jul-12 9:35am    
Then OnBlur and OnFocus functions can help you. I guess.
Ruwaldo 6-Jul-12 9:39am    
there is no onblur event for the body tag. intellisense doesnt show it.there is only a unload event

1 solution

Dear Sir,

<body onblur="fun_call()">

fun_call(){
//Write your condition here (eg. closing window)
}

if you want to check a value, get the value in an variable and use it.
This function will be call, when your web-page lost its focus.
The above function is to avoid navigation from window not from page.
If yours is page navigation please ignore this.
 
Share this answer
 
v2
Comments
Ruwaldo 6-Jul-12 9:35am    
Thanks i will give it a try now.

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