Click here to Skip to main content
15,893,487 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Page Pre_Init and Dynamic link buttons Pin
Abhishek Sur13-Sep-09 12:39
professionalAbhishek Sur13-Sep-09 12:39 
GeneralRe: Page Pre_Init and Dynamic link buttons Pin
Ersan Ercek13-Sep-09 20:33
Ersan Ercek13-Sep-09 20:33 
GeneralRe: Page Pre_Init and Dynamic link buttons Pin
Abhishek Sur13-Sep-09 21:24
professionalAbhishek Sur13-Sep-09 21:24 
QuestionSmtp mail in ASP.NET Pin
hit&run13-Sep-09 8:01
hit&run13-Sep-09 8:01 
AnswerRe: Smtp mail in ASP.NET Pin
Manas Bhardwaj13-Sep-09 8:19
professionalManas Bhardwaj13-Sep-09 8:19 
AnswerRe: Smtp mail in ASP.NET Pin
N a v a n e e t h13-Sep-09 8:32
N a v a n e e t h13-Sep-09 8:32 
GeneralRe: Smtp mail in ASP.NET Pin
Samarjeet Singh@india13-Sep-09 21:47
Samarjeet Singh@india13-Sep-09 21:47 
GeneralRe: Smtp mail in ASP.NET Pin
hit&run18-Sep-09 9:52
hit&run18-Sep-09 9:52 
I even tried that.

The method in Business Logic that sends mail is a public static method which calls Smtpmail.Send(). Here visibly the call halts till the mail is send.

I tried then with Smtpmail.SendAsync(). Here the debugger passes the Async immediately and returns to the WebService but does not return to the javascript (I tried also by preventing immediate closure of the window).

Here is something similar:

function InWebService()
{
// Code that gets some values from hidden fields etc.
XYZFullyQualifiedNamespace.MailWebService.SendNotifyMail(//All Parameters,OnSuccess,OnFailed)

window.close(); // Also worked with commenting it.
}

function OnSuccess()
{}

function OnFailed()
{}

//-------------------------

Webservice

[WebMethod]
public bool SendNotifyMail(//All required Paarmeters)
{

// Code
bool isSent = MailBusinessLogic.SendMail(//All required Paarmeters);

}

//-------------------------

MailBusinessLogic

public static SendMail
{
// Smtp preparation, Port, Server, bCC, cc etc

objSmtp.SendMail(objMsgBody); // <= OPERATIONAL LINE [OL]

}



I changed [OL] with

objSmtp.SendMailAsync(objMsgBody,stringObject);

Then tried starting a new thread in a new method and delegating a non-static version of SendMail to it. But to no avail. This problem seems all too powerful.

//
GIST:
If the window is left open the mails can be repeatedly sent. If closed, it cannot be sent after 2nd time, the window freezes. Also I noticed that on third send with the window open, there is a small lag as though its waiting for the thread to return or something.


--- Thanks for the concern Navneet.

P.S. The peculiar setup of functionality is courtsey the client's wet dream

Best Regards
QuestionAsp.net License Pin
G.K.M.13-Sep-09 5:28
G.K.M.13-Sep-09 5:28 
AnswerRe: Asp.net License Pin
Manas Bhardwaj13-Sep-09 6:09
professionalManas Bhardwaj13-Sep-09 6:09 
AnswerRe: Asp.net License Pin
N a v a n e e t h13-Sep-09 6:22
N a v a n e e t h13-Sep-09 6:22 
GeneralRe: Asp.net License Pin
Christian Graus13-Sep-09 12:14
protectorChristian Graus13-Sep-09 12:14 
GeneralRe: Asp.net License Pin
N a v a n e e t h13-Sep-09 16:02
N a v a n e e t h13-Sep-09 16:02 
QuestionProblem with ajax calender extender Pin
J.Vinod12-Sep-09 20:12
J.Vinod12-Sep-09 20:12 
AnswerRe: Problem with ajax calender extender Pin
Abhijit Jana12-Sep-09 21:20
professionalAbhijit Jana12-Sep-09 21:20 
QuestionPlaying MP3 Files Dynamically in ASP.Net App Pin
dboy22112-Sep-09 16:03
dboy22112-Sep-09 16:03 
AnswerRe: Playing MP3 Files Dynamically in ASP.Net App Pin
Christian Graus13-Sep-09 12:15
protectorChristian Graus13-Sep-09 12:15 
QuestionCustom Control Stops My Image Button Working! Pin
Ginozzzz12-Sep-09 5:45
Ginozzzz12-Sep-09 5:45 
AnswerRe: Custom Control Stops My Image Button Working! Pin
Blikkies12-Sep-09 5:58
professionalBlikkies12-Sep-09 5:58 
GeneralRe: Custom Control Stops My Image Button Working! Pin
Ginozzzz12-Sep-09 8:10
Ginozzzz12-Sep-09 8:10 
AnswerRe: Custom Control Stops My Image Button Working! Pin
dan!sh 12-Sep-09 9:12
professional dan!sh 12-Sep-09 9:12 
GeneralRe: Custom Control Stops My Image Button Working! Pin
Ginozzzz12-Sep-09 14:10
Ginozzzz12-Sep-09 14:10 
QuestionProblem with Custom Errors Pin
nagendrathecoder12-Sep-09 1:41
nagendrathecoder12-Sep-09 1:41 
AnswerRe: Problem with Custom Errors Pin
Parwej Ahamad12-Sep-09 1:57
professionalParwej Ahamad12-Sep-09 1:57 
GeneralRe: Problem with Custom Errors Pin
nagendrathecoder12-Sep-09 2:13
nagendrathecoder12-Sep-09 2:13 

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.