Click here to Skip to main content
15,891,529 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Attempted to read or write protected memory Pin
Ankit Maini31-Jan-12 1:05
Ankit Maini31-Jan-12 1:05 
QuestionOption Strict On disallows late binding Pin
Seema Bawa24-Jan-12 6:49
Seema Bawa24-Jan-12 6:49 
AnswerRe: Option Strict On disallows late binding Pin
jesarg25-Jan-12 6:19
jesarg25-Jan-12 6:19 
AnswerRe: Option Strict On disallows late binding Pin
jkirkerx25-Jan-12 13:00
professionaljkirkerx25-Jan-12 13:00 
Question'Sys' is Undefined Error Pin
vishnukamath23-Jan-12 22:53
vishnukamath23-Jan-12 22:53 
AnswerRe: 'Sys' is Undefined Error Pin
Bryian Tan24-Jan-12 16:57
professionalBryian Tan24-Jan-12 16:57 
AnswerRe: 'Sys' is Undefined Error Pin
jkirkerx25-Jan-12 12:54
professionaljkirkerx25-Jan-12 12:54 
QuestionIE issue with canceling the onBeforeUnload function Pin
ccrook23-Jan-12 7:36
ccrook23-Jan-12 7:36 
I am having an issue with canceling an event I added to the window's onBeforeUnload event, when the browser is IE (7,8, &9). In FireFox my RegisterOnSubmitStatement is sufficient to set a flag to skip the warning, but in IE that code gets called after the onBeforeUnload.

Here is the code in question:
ScriptManager.RegisterStartupScript(page, typeof(Functions), "NavigateAway", @"
                window.SuppressExitWarning = false;
                
                window.onbeforeunload = confirmExit;
                function confirmExit(evt) {
                    var message = '" + JsEscape(message) + @"';
                    if (window.SuppressExitWarning == true) return;

                    if (typeof evt == 'undefined') evt = window.event;
                    if (evt) evt.returnValue = message;
                    return message;                
                };", true);            
             
                
            ScriptManager.RegisterOnSubmitStatement(page, typeof(Functions), "AllowNavigateAway", @"
                window.SuppressExitWarning = true;               
            ");


If you add an alert to the "AllowNavigateAway" script, you can see the behaviour in IE -> The onBeforeUnload message pops up, then the alert.

I have tried several ways to solve it, but they all have a flaw of some sort.
A) Adding a setting of the global variable on the OnClientClick event to all possible form submitters will invariably miss something. That is to say, I do not have any idea of what controls will be on the page and even if I iterate through the control tree, I am likely to miss something that it not usually a control that submits but has it's AutoPostBack set to true. (e.g. DropDownList)

B) Using jQuery to attach a method to the submit of the form is not an option because CKEditor has locked it up.

C) Tracking the postback through a hidden input fails because it is not updated until after the onBeforeUnload.


Any thoughts or ideas would be greatly appreciated.
QuestionIssue with AppleMAC-Safari Pin
vanikanc23-Jan-12 7:03
vanikanc23-Jan-12 7:03 
AnswerRe: Issue with AppleMAC-Safari Pin
jkirkerx23-Jan-12 12:24
professionaljkirkerx23-Jan-12 12:24 
QuestionModify webpage controls in a contentplaceholder from a class.vb file Pin
Member 840806423-Jan-12 5:01
Member 840806423-Jan-12 5:01 
AnswerRe: Modify webpage controls in a contentplaceholder from a class.vb file Pin
manognya kota23-Jan-12 6:49
manognya kota23-Jan-12 6:49 
GeneralRe: Modify webpage controls in a contentplaceholder from a class.vb file Pin
Member 840806423-Jan-12 11:17
Member 840806423-Jan-12 11:17 
GeneralRe: Modify webpage controls in a contentplaceholder from a class.vb file Pin
manognya kota23-Jan-12 19:23
manognya kota23-Jan-12 19:23 
NewsRe: Modify webpage controls in a contentplaceholder from a class.vb file Pin
Member 840806424-Jan-12 10:44
Member 840806424-Jan-12 10:44 
GeneralRe: Modify webpage controls in a contentplaceholder from a class.vb file Pin
manognya kota24-Jan-12 22:49
manognya kota24-Jan-12 22:49 
QuestionMaking multiple teams coexist Pin
_Zorro_23-Jan-12 4:21
professional_Zorro_23-Jan-12 4:21 
QuestionHTTPS implmentation issue in asp.net Pin
afsal qureshi23-Jan-12 3:47
afsal qureshi23-Jan-12 3:47 
AnswerRe: HTTPS implmentation issue in asp.net Pin
jkirkerx25-Jan-12 13:14
professionaljkirkerx25-Jan-12 13:14 
QuestionAsp.net rdlc reports hanging in production (Ajax application) Pin
nikam.chetan23-Jan-12 1:56
nikam.chetan23-Jan-12 1:56 
AnswerRe: Asp.net rdlc reports hanging in production (Ajax application) Pin
thatraja23-Jan-12 2:27
professionalthatraja23-Jan-12 2:27 
QuestionHow to build business layer in MVC3 project? Pin
Tesic Goran22-Jan-12 9:08
professionalTesic Goran22-Jan-12 9:08 
AnswerRe: How to build business layer in MVC3 project? Pin
Anurag Gandhi23-Jan-12 0:39
professionalAnurag Gandhi23-Jan-12 0:39 
QuestionSeveral HTTPS sites on the same server! possible? Pin
abbd22-Jan-12 7:59
abbd22-Jan-12 7:59 
QuestionIFrame name Pin
Ali Al Omairi(Abu AlHassan)22-Jan-12 2:20
professionalAli Al Omairi(Abu AlHassan)22-Jan-12 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.