473,491 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to redirect another page after displaying JavaScript alert message in ASP.net

1 New Member
Hello All,

I want to redirect to some other directory page after displaying JavaScript alert message in ASP.net in a page.
For that I tried bellow code in our application ~/Profile/MyProfile.aspx.cs file

string redirectTo = "~/Logins/Login.aspx"; //The page I wish to redirect to.
string script = "<script>"; //Begin Script tag
script += "alert('" + ui_lblError.Text + "');"; //Javascript Alert box
script += "window.location='" + redirectTo + "'</script>"; //Redirect to the page specified above.

RegisterStartupScript("startup", script);

This is displaying alert message but not redirecting the login page. This also happning duto wrong file path.

Please let me know how do I manipulate the path.

Thanks in advance.

Regards,
Anupam
Anupam_jana@yahoo.com
Dec 30 '10 #1
0 2363

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6785
by: Oran | last post by:
Dear Friends, I am wondering, how can i show Alert() messages includes text aligned to the right of the message box on the screen. i am looking for something like the "\n" to do this. ...
2
2871
by: Kenneth | last post by:
Hi, In a document I have three lines that detects and redirects to another page is a session variable is 0 If Session("Customer_ID")=0 Then Response.Redirect("myPage.aspx") End If What I...
2
369
by: Marc Castrechini | last post by:
With SmartNavigation=true a call to display a simple javascript alert returns in IE showing an "Invalid Pointer" error. Apparently when SmartNavigation is disabled then the alert works correctly....
3
12625
by: musclehead | last post by:
Hi everyone, I have, what I hope, will be a simple question. I have a basic JS function to pop-up a confirm delete dialog box when deleting a record from a DB: function confirmDelete() { var...
0
1939
by: neeraj | last post by:
Hi Everybody I have one problem in my asp.net web application. The problem is that I check the date validation in code behind; if user not gives the valid data and press save button then I fire...
22
2286
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. Using...
3
3936
by: Wayne Deleersnyder | last post by:
Hi All, I'm trying to create a function that will cause a pop-up alert to appear if dates which were chosen from a drop-down list were invalid on a page. There's 4 dates, so there's the...
1
1549
by: somtabu | last post by:
Hello, in asp.net(VB), i want to display JavaScript alert message after the insert statement is completed. If the insert is failure then the alert message will not come.... Please help
4
1779
by: sva0008 | last post by:
Hi, How do i redirect page in the javascript function? I am using Response.redirect ("LoadDetail_DS.asp"); but it gives me error : 'Response' is undefined. Thanks
2
2389
by: PrasathPalani | last post by:
Dear Experts, I have a Datagrid with delete options. I use to confirm from users and delete record from data grid. I give confrimation after each record has deleted when a...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.