problem in alert
-
Hi all, I want to redirect the page after alert box is clicked . but the page redirects before the alert was called Wat to do..
-
Hi all, I want to redirect the page after alert box is clicked . but the page redirects before the alert was called Wat to do..
You should use javascript,fire function name from your control.
function ShowAlert()
{
alert('You will redirect in another page');
window.open(' yoururladdress/pagename.aspx');
}onclick="ShowAlert()"
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
You should use javascript,fire function name from your control.
function ShowAlert()
{
alert('You will redirect in another page');
window.open(' yoururladdress/pagename.aspx');
}onclick="ShowAlert()"
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Which control you are using to redirect in another page? If you are using button then use property
OnClientClick="ShowAlert(); return false;"
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Which control you are using to redirect in another page? If you are using button then use property
OnClientClick="ShowAlert(); return false;"
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Your core problem is that you think we're mind readers. Your code is broken. We can't fix it without seeing it.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
Your core problem is that you think we're mind readers. Your code is broken. We can't fix it without seeing it.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
This is the code at client side
function changed() {
alert('Password changed successfully');
window.open("UserProfile.aspx");
return false;
}I called it at the server side as
Page.RegisterStartupScript("Error", "changed()");
Response.Redirect("UserProfile.aspx");inside the click event of the button.That button will cause validation also. My problem is the page is redirected before alert is clicked.
-
This is the code at client side
function changed() {
alert('Password changed successfully');
window.open("UserProfile.aspx");
return false;
}I called it at the server side as
Page.RegisterStartupScript("Error", "changed()");
Response.Redirect("UserProfile.aspx");inside the click event of the button.That button will cause validation also. My problem is the page is redirected before alert is clicked.
According to me, the code should redirect to Default.aspx not UserProfile.aspx. In server side code, you register the client script block and then you redirected it to Default.aspx. You comment the Response.Redirect, it will start redirecting to UserProfile Page
Regards Aman Bhullar www.arlivesupport.com[^]
-
This is the code at client side
function changed() {
alert('Password changed successfully');
window.open("UserProfile.aspx");
return false;
}I called it at the server side as
Page.RegisterStartupScript("Error", "changed()");
Response.Redirect("UserProfile.aspx");inside the click event of the button.That button will cause validation also. My problem is the page is redirected before alert is clicked.
Yes, that's always going to be the case - why don't you put your redirection into the javascript function as well...
-
This is the code at client side
function changed() {
alert('Password changed successfully');
window.open("UserProfile.aspx");
return false;
}I called it at the server side as
Page.RegisterStartupScript("Error", "changed()");
Response.Redirect("UserProfile.aspx");inside the click event of the button.That button will cause validation also. My problem is the page is redirected before alert is clicked.
anu_anu wrote:
Page.RegisterStartupScript("Error", "changed()");
This injects script into the page.
anu_anu wrote:
Response.Redirect("UserProfile.aspx");
This redirects, so that your page is never rendered.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp