Reputation: 709
In my asp.net application, I will redirect to details.aspx page, which contains OK button. when "ok" button is clicked , i opens a Modal pop up extendar which contains submit and cancel button. On submit button click i am storing data in database on server side coding , after saving data i want to redirect the page into some other page say "Report.aspx". This i do as below,
$("[id$=btnQuerySubmit]").bind("click",function () {
window.location.href = "../web/Report.aspx";
});
But the above code closes Modal window, and remains in same details.aspx page. Not redirecting to Report.aspx page. I have tried below code as well,
window.open('../web/Report.aspx'); This redirects to report.aspx, but page opens in new tab. if i provide _self or _top there is no redirection is performed even in new tab.
I cannot use code behind , have to use Jquery as i need to check which browser is using by the user as below,
$(document).ready(function ($) {
"use strict";
// Detecting IE
var oldIE;
var a_href;
if ($('html').is('.ie6, .ie7, .ie8, .ie9')) {
oldIE = true;
}
if (oldIE) {
a_href = '../web/Report.aspx';
} else {
a_href = '../web/#/user/Report';
}
}(jQuery));
Any informations are most welcome.
Thanks in advance
sangeetha
Upvotes: 1
Views: 3623
Reputation: 2143
I think your model form gets closed before reaching window.location.href
Try changing your function like this.
$("[id$=btnQuerySubmit]").bind("click",function (event) {
event.preventDefault();
window.location.href = "../web/Report.aspx";
});
Upvotes: 1