Solved

Allow mesage box to popup on redirect of page

Posted on 2011-02-12
8
566 Views
Last Modified: 2012-05-11
I have made a popup that works within an update panel but what I can't get to work is that it calls the response.redirect to the home page right away instead of giving me the popup box.  Is there a way to get around this.  I insert my sql to the db, then call the popup but and then want to redirect to home page.  but it automatically goes to home page is there a way to stop it until message is seen then redirect.



insertUpdateDelete(sql)

        ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "message();", True)

        Response.Redirect("~/Home.aspx")

0
Comment
Question by:kdeutsch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 12

Expert Comment

by:starlite551
ID: 34879470
Yes use this code :
string message ="Success";
Response.Write(
"<script language='javascript'>alert('"+message+"');</script>");

Open in new window

0
 
LVL 12

Expert Comment

by:starlite551
ID: 34879475
Sorry I forgot this is VB.NET Section heres your code :
Dim message As String = "Success"
Response.Write("<script language='javascript'>alert('" & message & "');</script>")

Open in new window

0
 
LVL 12

Assisted Solution

by:starlite551
starlite551 earned 150 total points
ID: 34879481
call this code before calling Response.Redirect("~/Home.aspx")
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

Author Comment

by:kdeutsch
ID: 34879625
Do I need to make a javascript message in my html, currently I have the meesge in a javascript file, and will this work with an updatepanel.
0
 

Author Comment

by:kdeutsch
ID: 34879629
Ok, see what you how it is, does not work.  

 insertUpdateDelete(sql)

        Dim message As String = "Success"
        Response.Write("<script language='javascript'>alert('" & message & "');</script>")

        'ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "message();", True)

        Response.Redirect("~/Home.aspx")
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 200 total points
ID: 34879812
Use your original code but redirect using the JavaScript rather than code behind because the code behind would not wait for popup.
0
 

Assisted Solution

by:kdeutsch
kdeutsch earned 0 total points
ID: 34879848
ok, got it, here is the final solution.

ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "OnClick", "alert('Your SRP Event has been saved. It is only valid from beginning date for 3 days!');window.location.href='../Home.aspx';", True
0
 

Author Closing Comment

by:kdeutsch
ID: 34914355
thanks
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question