开发者

Asp.net jquery and alert with click anywhere on page

开发者 https://www.devze.com 2023-02-04 14:24 出处:网络
I have an asp.net 4.0 page with a listbox, textbox and a ajax tabcontainer. On one of the tabs of the tab container there is a usercontrol. When I enter “edit mode” (by the user clicking an asp:butt

I have an asp.net 4.0 page with a listbox, textbox and a ajax tabcontainer. On one of the tabs of the tab container there is a usercontrol. When I enter “edit mode” (by the user clicking an asp:button cal开发者_StackOverflowled Edit) in the usercontrol on that tab, I would like to display an alert when the user tries to click or nav by tabbing anywhere outside of that user control. E.g. “You must save your changes first…”

Is there a way with jquery that I could setup just one function that say traps the click on another tab or any control outside of that usercontrol?

I have my usercontrol so it can send an event to the parent when it enters “edit mode”.

Oh yeah, I also have update panels in the mix.


You can use this: http://api.jquery.com/blur/

0

精彩评论

暂无评论...
验证码 换一张
取 消