473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Response.Redirect not being called after sending an email

The last two lines of code in the Click event of a Button Control on my page
are:
Me.WelcomeEmail()
Response.Redirect("mainmenu.aspx")
The last line of code in Me.WelcomeEmail() is:
Mail.SmtpMail.Send(mailmsg)
When the Click event is triggered, all of the code in Me.WelcomeEmail() is
successfully executed, and the email is successfully sent, but the
Response.Redirect("mainmenu.aspx") line is not executed, and a blank page is
displayed with the URL of the page that this code is run from. However, if I
use Server.Transfer instead as follows:
Me.WelcomeEmail()
Server.Transfer("mainmenu.aspx")
Response.Redirect("mainmenu.aspx") 'This line obviously won't get executed
here because Server.Transfer is executed first
The Server.Transfer line does get executed, and I see the page
mainmenu.aspx. However, I do not want this because I want the displayed URL
to match the displayed page, which is not true when using Server.Transfer.
Why is Response.Redirect not working here, and what can I do to fix it?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Jun 23 '06 #1
2 2019

"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
The last two lines of code in the Click event of a Button Control on my
page are:
Me.WelcomeEmail()
Response.Redirect("mainmenu.aspx")
The last line of code in Me.WelcomeEmail() is:
Mail.SmtpMail.Send(mailmsg)
When the Click event is triggered, all of the code in Me.WelcomeEmail() is
successfully executed, and the email is successfully sent, but the
Response.Redirect("mainmenu.aspx") line is not executed, and a blank page
is displayed with the URL of the page that this code is run from. However,
if I use Server.Transfer instead as follows:
Me.WelcomeEmail()
Server.Transfer("mainmenu.aspx")
Response.Redirect("mainmenu.aspx") 'This line obviously won't get executed
here because Server.Transfer is executed first
The Server.Transfer line does get executed, and I see the page
mainmenu.aspx. However, I do not want this because I want the displayed
URL to match the displayed page, which is not true when using
Server.Transfer. Why is Response.Redirect not working here, and what can I
do to fix it? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Sounds like you have an incomplete path to the page.
Jun 24 '06 #2
I doubt that is the problem, for several reasons.

1. mainmenu.aspx is in the same directory as the page that this code is in,
so I shouldn't need anything other than the filename, right?
2. If that was the problem, wouldn't it give me an error saying it could not
find mainmenu.aspx?
3. Why is Server.Transfer working when I do not pass it anything other than
the filename?
4. I tried using the complete URL (http://www.mydomain.org/mainmenu.aspx),
but it did not make any difference.

However, I think that I did find the reason, but I think it will require a
compromise. When I do a view source on the blank page that shows up when it
should be redirected to mainmenu.aspx, I see two body tags and a set of tags
that I think come from ASP.NET's SmartNav feature. One of the attributes in
this tag is the URL that it should be redirected to. I think that the
SmartNav feature is what is causing the problem, so I guess I'll have to do
without it for now.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"vMike" <Mi****************@noYandZ.geZwaYrrenZ.com> wrote in message
news:7d*****************@bignews1.bellsouth.net...

"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
The last two lines of code in the Click event of a Button Control on my
page are:
Me.WelcomeEmail()
Response.Redirect("mainmenu.aspx")
The last line of code in Me.WelcomeEmail() is:
Mail.SmtpMail.Send(mailmsg)
When the Click event is triggered, all of the code in Me.WelcomeEmail()
is successfully executed, and the email is successfully sent, but the
Response.Redirect("mainmenu.aspx") line is not executed, and a blank page
is displayed with the URL of the page that this code is run from.
However, if I use Server.Transfer instead as follows:
Me.WelcomeEmail()
Server.Transfer("mainmenu.aspx")
Response.Redirect("mainmenu.aspx") 'This line obviously won't get
executed here because Server.Transfer is executed first
The Server.Transfer line does get executed, and I see the page
mainmenu.aspx. However, I do not want this because I want the displayed
URL to match the displayed page, which is not true when using
Server.Transfer. Why is Response.Redirect not working here, and what can
I do to fix it? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Sounds like you have an incomplete path to the page.

Jun 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
7
by: Stephanie | last post by:
If response.buffer is set to true, and no response.flush has been executed, is it accurate to expect that my browser should not be rendering the content which I (well Ok, someone else) is sending...
2
by: WJ | last post by:
1. I have a website called "myWeb" resides under E:\SOS\myWeb.Net" folder in an IIS-6/Windows 2003 server. Its host-header is "myWeb.Net". 2. Default page is "Index.aspx". 3. In the same...
1
by: csgraham74 | last post by:
i have the following code Response.AddHeader("content-disposition", "attachment; filename=" & str_AccountNo & ".pdf") Response.ContentType = "application/pdf"...
4
by: Martyn Fewtrell | last post by:
Hi there I am developing an ASP.Net form which submits to a non ASP.net script (not through choice!). Basically the form collates a whole bunch of data and builds a query string from the...
6
by: dwclark | last post by:
I am having an issue when I trigger a Response.Redirect, the Page_Load fires on the page where the Response.Redirect was called. From what I've read, this should not happen and the browser should...
2
by: Nathan Sokalski | last post by:
The last two lines of code in the Click event of a Button Control on my page are: Me.WelcomeEmail() Response.Redirect("mainmenu.aspx") The last line of code in Me.WelcomeEmail() is:
11
by: Paul Furman | last post by:
I'm setting up credit card payment through authorize.net and they have the option to send a POST string back to my site once complete. I'm not sure how to proceed. They don't have much to read...
9
by: Nick | last post by:
Hi there, I would like to perform something like the following from my vb.net web service, being invoked via HTTP Post Call HttpContext.Current.Response.Redirect("myprotocol://myurl") ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.