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

ASP.NET

 
QuestionJava Script proble Pin
Amit Patel198513-Sep-09 19:55
Amit Patel198513-Sep-09 19:55 
AnswerRe: Java Script proble Pin
Christian Graus13-Sep-09 20:44
protectorChristian Graus13-Sep-09 20:44 
GeneralRe: Java Script proble Pin
Amit Patel198513-Sep-09 20:50
Amit Patel198513-Sep-09 20:50 
GeneralFind out solution Pin
Amit Patel198513-Sep-09 21:21
Amit Patel198513-Sep-09 21:21 
QuestionScroll bar in a checkList box Pin
Swetha Srinivasan13-Sep-09 19:53
Swetha Srinivasan13-Sep-09 19:53 
AnswerRe: Scroll bar in a checkList box Pin
Samarjeet Singh@india13-Sep-09 20:17
Samarjeet Singh@india13-Sep-09 20:17 
AnswerRe: Scroll bar in a checkList box Pin
r a m e s h13-Sep-09 20:30
r a m e s h13-Sep-09 20:30 
AnswerRe: Scroll bar in a checkList box Pin
nimeshmca16-Mar-10 20:48
nimeshmca16-Mar-10 20:48 
Question'top.screenLeft' is null or not an object [modified] Pin
Vijayitsb13-Sep-09 19:49
Vijayitsb13-Sep-09 19:49 
Questionerror after uploading on server Pin
Harry@NewDelhi13-Sep-09 19:47
Harry@NewDelhi13-Sep-09 19:47 
AnswerRe: error after uploading on server Pin
Christian Graus13-Sep-09 20:45
protectorChristian Graus13-Sep-09 20:45 
GeneralRe: error after uploading on server Pin
Harry@NewDelhi13-Sep-09 20:55
Harry@NewDelhi13-Sep-09 20:55 
QuestionAbout HtmlArea.. Pin
lsh486love13-Sep-09 19:13
lsh486love13-Sep-09 19:13 
AnswerRe: About HtmlArea.. Pin
Christian Graus13-Sep-09 19:24
protectorChristian Graus13-Sep-09 19:24 
QuestionPage Pre_Init and Dynamic link buttons Pin
Ersan Ercek13-Sep-09 10:10
Ersan Ercek13-Sep-09 10:10 
AnswerRe: Page Pre_Init and Dynamic link buttons Pin
Christian Graus13-Sep-09 12:04
protectorChristian Graus13-Sep-09 12:04 
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 

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.