A manager got the same email 7000 times today and he's not smiling. HELP!
How can a web page without a loop, going into an infinite loop? (Asp.Net C#)
We have techs who download training material PDFs, DOCs etc.
The managers want to know what the techs are studying
so right before the download I send the manager an email.
A thousand downloads work fine, then one appears to "hang" (file size is random)
During this "hang" time, the same manager email is being sent endlessly
until the tech gives up waiting and cancels the download.
There are no code loops, I can't see how the browser would cause the loop...
To email, and leave the link page available, I use two pages.
Page 1 has asp:HyperLinks with a TARGET to open a new page.
That page is always Page 2 (while I pass PDF path).
Page 2 (looping) is simple: send the email, then response.redirect to the download file.
The tech sees a new page open and his download starts.
I have never been able to reproduce this for debugging.
I get no error in my try/catch or globally.
Thanks for any ideas out there!
Steve
-------------------------------------------------------------------------
Update 1: My code involved
(I was trying my best to keep the post short... but here's the core code if that helps)
Also the tech said, it may have happened when his IE browser allowed him to save before the download had completed. But I have not been able to reproduce the loop by that method.
-------------------------------------------------------------------------
Page 1: A HyperLink in a GridView
Pass the path/name to a page called "bounce"
<asp:HyperLink ID="hlBounce" runat="server"
Text='<%# Eval("FileName") %>'
NavigateUrl='<%# "~/private/training/courses/Bounce.aspx?pth=" + Eval("FullPath") + "&nam=" + Eval("FileName") %>'
Target="_Blank" />
Page 2: Email and Redirect to PDF
protected void Page_Load(object sender, EventArgs e)
{
if (sFilePath != "")
{
try
{
conn.Open();
string sResult = EmailMgr(sFilePath);
}
catch (Exception ex)
{
eh.SaveErrorText(ex.Message.ToString(), ex.ToString(), sFilePath);
}
finally
{
conn.Close();
}
Response.Redirect(sFilePath, false);
}
Response.End();
}