Click here to Skip to main content
15,890,825 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Replace ImagePlaceHolder1 in Word 2007 with the image selected in Combo box in C#.net Windows Application Pin
raghvendrapanda10-Aug-10 22:42
raghvendrapanda10-Aug-10 22:42 
Questionhex string to sql and to website Pin
meenu s9-Aug-10 12:32
meenu s9-Aug-10 12:32 
QuestionQuestion about saving an image to SQL database Pin
Aptiva Dave9-Aug-10 10:09
Aptiva Dave9-Aug-10 10:09 
AnswerRe: Question about saving an image to SQL database Pin
NeverHeardOfMe9-Aug-10 10:32
NeverHeardOfMe9-Aug-10 10:32 
GeneralRe: Question about saving an image to SQL database Pin
InderK10-Aug-10 1:29
InderK10-Aug-10 1:29 
QuestionThread from code behind aspx Pin
devvvy9-Aug-10 2:34
devvvy9-Aug-10 2:34 
AnswerRe: Thread from code behind aspx Pin
Prosanta Kundu online9-Aug-10 2:52
Prosanta Kundu online9-Aug-10 2:52 
AnswerRe: Thread from code behind aspx Pin
NeverHeardOfMe9-Aug-10 3:27
NeverHeardOfMe9-Aug-10 3:27 
As an alternative to using System.Threading, which I have to admit I find a difficult class to get to grips with, can I suggest an alternative method for executing a long running process (LRP) within as ASP.NET appliucation...

..this is only of any real use when you can set up your LRP in such a way that you can execute it by passing just an ID number (say to a database record), or at least only a relatively small amount of data to it via a QueryString.

Set up your LRP within a generic handler, say "lrp.ashx"

Them, in your webapage when you want to execute this, add:

Try
   Dim request As System.Net.HttpWebRequest = DirectCast(System.Net.WebRequest.Create(HttpPathOf("lrp.ashx")), System.Net.HttpWebRequest)
   request.Method = "POST"
   request.ContentType = "application/x-www-form-urlencoded"
   Dim postData As String = "id=" & nid.ToString  ' for example - set up whatever data you need to post to the handler here
   request.ContentLength = postData.Length

   Dim writer As New System.IO.StreamWriter(request.GetRequestStream(), System.Text.Encoding.ASCII)
   writer.Write(postData)
   writer.Close()

Catch ex As Exception
   ' whatever
End Try


Note: by

HttpPathOf("lrp.ashx")

I mean the full URL (ie starting "http://www.mydomain...." to lrp.ashx - you can't just use a relative URL or Server.MapPath

The above code will execute lrp.ashx in a new process, adn you can (for example) immediately redirect to another page while it is still executing, adn yor users will never know....

Perhaps someone here willl tell me why I shouldn't be doiung this, but I've found it works very well Smile | :)

And no, I can't translate it into C#! Poke tongue | ;-P
QuestionNeed example code for making an universal table editor... Pin
Hrizip8-Aug-10 21:14
Hrizip8-Aug-10 21:14 
AnswerRe: Need example code for making an universal table editor... Pin
R. Giskard Reventlov8-Aug-10 21:48
R. Giskard Reventlov8-Aug-10 21:48 
GeneralRe: Need example code for making an universal table editor... Pin
Hrizip9-Aug-10 1:41
Hrizip9-Aug-10 1:41 
Questionsum of work hours in rdlc Pin
Thanusree Duth8-Aug-10 19:14
Thanusree Duth8-Aug-10 19:14 
AnswerRe: sum of work hours in rdlc Pin
Tej Aj9-Aug-10 23:54
Tej Aj9-Aug-10 23:54 
QuestionPOP Up control Extender validation Pin
Amit Patel19858-Aug-10 19:01
Amit Patel19858-Aug-10 19:01 
AnswerRe: POP Up control Extender validation Pin
T M Gray9-Aug-10 11:17
T M Gray9-Aug-10 11:17 
GeneralRe: POP Up control Extender validation Pin
Amit Patel19859-Aug-10 19:42
Amit Patel19859-Aug-10 19:42 
GeneralRe: POP Up control Extender validation Pin
Mugdha_Aditya10-Aug-10 3:17
Mugdha_Aditya10-Aug-10 3:17 
GeneralRe: POP Up control Extender validation Pin
Mugdha_Aditya10-Aug-10 3:18
Mugdha_Aditya10-Aug-10 3:18 
Questionrdlc page break Pin
Thanusree Duth8-Aug-10 18:47
Thanusree Duth8-Aug-10 18:47 
AnswerRe: rdlc page break Pin
C#Coudou8-Aug-10 19:17
C#Coudou8-Aug-10 19:17 
AnswerRe: rdlc page break Pin
Tej Aj8-Aug-10 21:26
Tej Aj8-Aug-10 21:26 
QuestionDropdownlist gridview Pin
C#Coudou8-Aug-10 16:24
C#Coudou8-Aug-10 16:24 
AnswerRe: Dropdownlist gridview Pin
Not Active8-Aug-10 17:10
mentorNot Active8-Aug-10 17:10 
GeneralRe: Dropdownlist gridview Pin
C#Coudou8-Aug-10 18:33
C#Coudou8-Aug-10 18:33 
AnswerRe: Dropdownlist gridview Pin
Arun Jacob8-Aug-10 20:06
Arun Jacob8-Aug-10 20:06 

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.