Click here to Skip to main content
15,915,083 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Internal ASP.NET threading model Pin
dojohansen11-Feb-08 23:26
dojohansen11-Feb-08 23:26 
GeneralRe: Internal ASP.NET threading model Pin
dojohansen11-Feb-08 23:31
dojohansen11-Feb-08 23:31 
GeneralRe: Internal ASP.NET threading model Pin
ToddHileHoffer12-Feb-08 1:31
ToddHileHoffer12-Feb-08 1:31 
GeneralRe: Internal ASP.NET threading model Pin
dojohansen12-Feb-08 2:12
dojohansen12-Feb-08 2:12 
GeneralRe: Internal ASP.NET threading model Pin
ToddHileHoffer12-Feb-08 2:22
ToddHileHoffer12-Feb-08 2:22 
GeneralRe: Internal ASP.NET threading model Pin
dojohansen12-Feb-08 3:00
dojohansen12-Feb-08 3:00 
GeneralRe: Internal ASP.NET threading model Pin
ToddHileHoffer12-Feb-08 3:16
ToddHileHoffer12-Feb-08 3:16 
QuestionRequest is not available in this context Pin
Ryno Burger11-Feb-08 6:34
Ryno Burger11-Feb-08 6:34 
Hi guys

I have a function called SendEmail which runs within a thread.

This function simply send an email to the user.

However, I made a "Please Wait..." page while the email gets send in the background the user see the "Please Wait..." page.

<br />
public void SendEmail()<br />
{<br />
StringBuilder messageText = new StringBuilder();<br />
<br />
messageText.AppendLine(string.Format("Name: {0} {1}", txtName.Text.Trim().ToString(), txtSurname.Text.Trim().ToString()));<br />
messageText.AppendLine(string.Format("Contact Number: {0}", txtContactNumber.Text.Trim().ToString()));<br />
messageText.AppendLine(string.Format("Email Address: {0}", txtEmail.Text.Trim().ToString()));<br />
messageText.AppendLine(string.Format("Comments: {0}\n\n", txtComments.Text.Trim().ToString()));<br />
messageText.AppendLine(string.Format("Quote Reference Nr: {0}", Request.QueryString["quoteNr"].ToString())); // Breaks here with error: Request is not available in this context<br />
<br />
// Send the email to the user<br />
}<br />


I call the SendEmail() function using the following lines of code:

<br />
Guid id = Guid.NewGuid();<br />
<br />
ThreadStart ts = new ThreadStart(SendEmail);<br />
<br />
Thread th = new Thread(ts);<br />
<br />
th.Start();<br />
<br />
Response.Redirect(string.Format("PleaseWait.aspx?ID={0}&type={1}", id, "email"));<br />


Is it true that you can't access Request data within a thread, if not, how do I then get access to Request.QueryString data?
GeneralRe: Request is not available in this context Pin
dojohansen11-Feb-08 7:49
dojohansen11-Feb-08 7:49 
GeneralRe: Request is not available in this context Pin
Not Active11-Feb-08 7:59
mentorNot Active11-Feb-08 7:59 
Generalneed regular expression of a strict (999) 999-9999 Format Pin
Rocky#11-Feb-08 6:05
Rocky#11-Feb-08 6:05 
AnswerRe: need regular expression of a strict (999) 999-9999 Format Pin
dilipv11-Feb-08 19:41
dilipv11-Feb-08 19:41 
GeneralRe: need regular expression of a strict (999) 999-9999 Format Pin
Rocky#11-Feb-08 19:52
Rocky#11-Feb-08 19:52 
GeneralASP.NET C# Mifare Reader Web System Pin
Tyrone Boon11-Feb-08 5:57
Tyrone Boon11-Feb-08 5:57 
GeneralCross Post Pin
led mike11-Feb-08 6:18
led mike11-Feb-08 6:18 
Generaloutlook in asp.net Pin
i gr811-Feb-08 3:50
i gr811-Feb-08 3:50 
GeneralRe: outlook in asp.net Pin
Not Active11-Feb-08 5:09
mentorNot Active11-Feb-08 5:09 
GeneralRe: outlook in asp.net Pin
i gr811-Feb-08 7:48
i gr811-Feb-08 7:48 
GeneralRe: outlook in asp.net Pin
Not Active11-Feb-08 7:54
mentorNot Active11-Feb-08 7:54 
GeneralRe: outlook in asp.net Pin
Christian Graus11-Feb-08 18:09
protectorChristian Graus11-Feb-08 18:09 
QuestionShow/Hide columns in report.rdlc localreport Pin
Member 438223211-Feb-08 3:00
Member 438223211-Feb-08 3:00 
GeneralRe: Show/Hide columns in report.rdlc localreport Pin
Paddy Boyd11-Feb-08 3:18
Paddy Boyd11-Feb-08 3:18 
GeneralRe: Show/Hide columns in report.rdlc localreport Pin
Member 438223211-Feb-08 3:57
Member 438223211-Feb-08 3:57 
GeneralRe: Show/Hide columns in report.rdlc localreport Pin
anshul3129-Nov-09 22:19
anshul3129-Nov-09 22:19 
GeneralRe: Show/Hide columns in report.rdlc localreport Pin
Member 438223229-Nov-09 23:12
Member 438223229-Nov-09 23:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.