?
Solved

Allow mesage box to popup on redirect of page

Posted on 2011-02-12
8
Medium Priority
?
568 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 600 total points
ID: 34879481
call this code before calling Response.Redirect("~/Home.aspx")
0
Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

 

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 800 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 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