A loading panel is displayed after canceling a partial postback in javascript on the PageRequestManagers InitalizeRequest event handler. How do I get rid of the loading panel? Is there any other way to cancel the partial postback?
I have radio buttons in the command section of an ajaxified RadGrid.
<
CommandItemTemplate
>
<
asp:RadioButton
ID
=
"sortByDateOfEntryRadioButton"
AutoPostBack
=
"true"
OnCheckedChanged
=
"ReOrderTimesheetItems"
runat
=
"server"
Text
=
"Order Of Entry"
GroupName
=
"TimesheetItemSortOrder"
/>
<
asp:RadioButton
ID
=
"sortByDateOfTimesheetItemDateRadioButton"
AutoPostBack
=
"true"
OnCheckedChanged
=
"ReOrderTimesheetItems"
runat
=
"server"
Text
=
"Timesheet Date/Time"
GroupName
=
"TimesheetItemSortOrder"
/>
</
CommandItemTemplate
>
I stop the partial post back that occurs when selecting a radio button if the form is dirty. using the javascript below.
The partial postback is sucessfully canceled on the line args.set_cancel(true) but the loading panel is still displayed.
function
initRequest(sender, args) {
var
isSortingTimesheetItems =
((args.get_postBackElement().id.indexOf(
"sortByDateOfTimesheetItemDateRadioButton"
) != -1)
|| (args.get_postBackElement().id.indexOf(
"sortByDateOfEntryRadioButton"
) != -1))
if
(isSortingTimesheetItems) {
// this check has to be done here to stop the partial post back
if
(!FormIsDirty()) {
args.set_cancel(
true
);
//stop async request
return
;
}
}
}
function
RegisterScriptManagerInitializeRequestEvent() {
Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(initRequest);
}
How do I get rid of the loading panel?
Is there any other way to cancel the partial postback?