.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Should a call back method always be used when working with smtp?

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
I read about a call back method that was used with some code for an smtp client.  Should callback methods always be used to verify delivery and get status codes when working with smtp relays and clients? 

View Complete Post

More Related Resource Links

SMTP not working if I use web deployment package to deploy my app.


Hi all

I use msdeploy to install my web app. deployment package. everything about web app works, but find out email was not working.

I checked telnet smtp is running.

I debug the project, and it was sending out email too.

So my solution was upload the whole project (not complied) to wwwroot, and email works too. Thats why I assume the deployment cause the problem.

at last, I also tried to copy the web deployment web.config to replace the project's web.config, and the email also work, so it wasn't the web.config problem.

Could anyone tell me whats going on?

My environment:

window 2003

iis 6

.net framework 4.0

Hi this method is working fine need filter how


private void GetData()
        for (int i = 0; i < Gridview1.Rows.Count; i++)
            DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
            DataRowView drv = dv[i];

Call a web method in Javascript


Hi All,

I am first time working on web service and Javascript and trying to call a Web Method (web service) on a button click in Javascript.

What I want to achieve is as followed: When the button is clicked, call the web method, get the return URL value and store it to a session variable, the redirect the page to another page. However, this works only when the internet traffic is fast, it give me error when internet is slow as the Javascript is executed much faster than the web service. Is there any way to handle this?  Would be much appreciated for your help! Cheers.

Code as below:


function emailButton_onClick()


function getCurrentMapURL(getCurrentMapURLOnSuccess)
var proxy_url = 'WebService/GPSWebService.asmx/GetCurrentMap';

var response = map.print([proxy_url]);



function getCurrentMapURLOnSuccess()
emailAddress = document.getElementById('txtEmailAddress').value;

if(emailAddress != null)
alert('Do you want to send report

Call back mechanism in C# with C++ DLL

Hi , i have created an Delegate for a call back mechanism in C# it looks like this.   C# public delegate void LogProc(StructureA objAppcontext,[MarshalAs(UnmanagedType.I4)] int level,[MarshalAs(UnmanagedType.LPWStr)] string thisFile,[MarshalAs(UnmanagedType.I4)] int thisLine, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder logMessage);   this C# delegate is passed to the C++ DLL by another method which is marshalled   C++ DLL static void LogProc (StructureA * context, const int level, const WCHAR * thisFile, const int thisLine, const WCHAR* logMessage)   when the call back function is called it invokes my C# method ie. LogProc, but still when it goes back to C++ DLL i am getting the following Error Message   Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.   Can anybody help me out on this issue

ScriptManager.RegisterStartupScript is not working after post back

Hi,          I am registering javascript after page  post back using ScriptManager.RegisterStartupScript . it used to work previously. Ater there are some chagnes done in the project now it is not working. What might be the reason behind this. now i am unable to register the javascript after post back.Thanks and Regards,kiran

WCF Basic Http Binding - Two server requests per method call

We have a service that uses BasicHttpBinding/Transport Security/Windows Authentication and is hosted in IIS. I have created a unit-test application in VSTS and whenever we test a WCF method, Fiddler records two calls. 1st call - No authorization token is sent. The WCF service returns a 401 error - Unauthorized: Access is denied. Http headers as sent in the request given below. POST http://localhost/AccountScreen.svc HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "IAccountScreen/RetrieveAccountDetails" Host: localhost Content-Length: 243 Expect: 100-continue Connection: Keep-Alive 2nd call - Authorization token is sent and the WCF service returns the expected response. POST http://localhost/AccountScreen.svc HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "IAccountScreen/RetrieveAccountDetails" Authorization: Negotiate Host: localhost Content-Length: 243 Expect: 100-continue I am not able to figure out why there are two calls made to the server in the first place and what is the significance of the first call. Any thoughts?

AJAX call is not working on F5 load balancer web farm setup

I have the following web farm setup in production server.Browser --> HTTPS --> Load Balancer --> HTTP --> webserver nodeF5 Load balancer handles off box SSL termination. It implies that SSL resides on F5 load balancer. Problem Statement: Ajax calls do not go through unless "Access data sources across domains" option is enabled in IE security settings. I have the similar setup in staging server except F5 Load balancer. The ASP.Net application makes perfect AJAX calls on both HTTP and HTTPS.However, the staging server web farm use windows NLB and SSL resides on individual web server nodes

How to call CodeBehind Method from Client Side

Hi forumers,How can we call a CodeBehind Method with Arguement from Client Side?Here is the idea: this wont work<script type='text/javascript"> function func(){ var str = 'Hello World'; var result = '<% =CodeBehindFunction( str ) %>' } </script>I have a variable "str" and has a value of "Hello World".. I want to pass the value of "str" to the CodeBehind Method which is "CodeBehindFunction(object obj)"..How can I accomplish this idea without the use of XMLhttprequest, is it possible?

window.XMLHttpRequest - Is it possible to call the Method which is present on the same page?

Dear Friends, I am using the below XML HTTP Request for checking the username whether already exist or not, What i am doing is i am opeing a page on xmlhttp.open("GET", "CheckUserNameSupportiveFile.aspx?UserName=" + username, true); And passing the username to check with database. if (window.XMLHttpRequest) { // code for all new browsers xmlhttp = new XMLHttpRequest(); }if (xmlhttp != null) { xmlhttp.onreadystatechange = state_Change; var adad = username = document.getElementById('<%=txtUserName.ClientID %>').value; // alert(adad); xmlhttp.open("GET", "CheckUserNameSupportiveFile.aspx?UserName=" + username, true); xmlhttp.send(null); }but what i want to do is, IS IT POSSIBLE WITHOUT CALLING ANOTHER PAGE [CheckUserNameSupportiveFile.aspx?UserName=" + username ] Can i check it on the same page itself by calling method OR something on the same page itself.I do not want to pass the value to another page on and check it with DB, i want to do in same page itself.All your suggestion / advice are welcome.

call a server side C# method from javascript

http://forums.asp.net/t/1591584.aspx Hi friends, can anyone provide me the C# code of the above post answer(pls go to the link)..i didnt understand the VB code... i dont know VB.. my problem also same.. i have a method in a class in App_Code folder... i want to call that method from javascript.. the method takes one parameter which is list box cotrol id... the list box control also available in the same page..   Please can anyone help me on this..

How to call a method with IDataObject in click event in wpf?

As I'm new in WPF development, I came up with a problem, looks like simple, however, I couldn't solve. The problem is, how to call a method with IDataObject in a click event?? I've a method like:  public void setProperty(IDataObject obj)         {                                      PropertyGrid mygrid = new PropertyGrid();                        UIElement elt = ExtractElement(obj);             Type t = elt.GetType();             string name = (string)t.GetProperty("Name").GetValue(elt, null);             mygrid.Instance = name;         } I want to call this method in a click event. I don't know how to. I've tried but couldn't yet. Any help will be appreciated regarding this. Thank you.   Regards, Binaya

WPF method call between 2 Windows

I have a Window called MenuWindow and ControlWindow and I wanted the call a method void Sync() in ControlWindow from MenuWindow Im confused because i havent done this through 2 windows that were not the MainWindow. Normally i would do it like so ((MainWindow)Application.Current.MainWindow).Sync(); but how do i do it if its not the main Window?

dgw programmatically call a method

I have a method on a dataGridView, which is fully addressed like this: private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { //code }   I would like to access to this method programmatically, without mouse double click. And I have to pass a parameter of a row index. I have tried to pass an integer, but I got an error (cannot convert from 'int' to 'System.Windows.Forms.DataGridViewCellEventArgs), like: foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value.ToString() == _myCellName) { dataGridView1.Rows[row.Index].Selected = true; dataGridView1_CellDoubleClick(null, row.Index); //here Im trying to pass a value for the upper method break; } }   When the upper method (dgw_CellDoubleClick) is programmatically called, I would like to call an "e", with: if(e.RowIndex > 0) { //code } So what to pass from to the method, that will work?

ILGenerator : call DynamicMethod with Emit method

A sample of what I try to do :     class Program     {         static void Main(string[] args)         {             GenerationIL();         }         public static void GenerationIL()         {             Action oDynamicMethod = DynamicMethod();             DynamicMethod dm = new DynamicMethod("Run", null, Type.EmptyTypes);             ILGenerator oILGenerator = dm.GetILGenerator();             oILGenerator.Emit(OpCodes.Call, oDynamicMethod.Method); // Runtime ERROR             oILGenerator.Emit(OpCodes.Ret);             ((Action)dm.CreateDelegate(typeof(Action))).Invoke();         }         public static Action DynamicMethod()         {             DynamicMethod dm = new DynamicMethod("Todo", null, Type.EmptyTypes);             ILGenerator oILGenerator = dm.GetILGenerator();          &nbs

Sending email via SmtpClient() not working with smtp.gmail.com :(

Help I cannot seem to send an email via my gmail account using "C#" why not?   <system.net> <mailSettings> <smtp deliveryMethod="Network" from="ian.coetzer@gmail.com"> <network host="smtp.gmail.com" port="587" enableSsl ="true" defaultCredentials ="false" password ="xxxxxx" userName ="ian.coetzer@gmail.com"></network> </smtp> </mailSettings> </system.net> SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { message.To.Add(emailTo); message.Subject = ""; message.Body = GetEmailBody(userName, password, url); smtpClient.Send(message); return true; } catch(Exception ex) { throw new ApplicationException("Could not send notification.", ex); }   I.W Coetzer

Is there a way to save a refernece to a method in a Tag property and call that method directly from

Hello, Here is a tough one, probably only answerable by someone who really knows his stuff. In the WPF program below, I would like to completely eliminate the necessity of the "LoadIt" method.  The way I'd like to do it is by saving the address ( or some other appropriate information ) of the method to be called to add a Person or Pet to the Expander's Tag.  Then, when the Add button is clicked, the Expander's Tag is read and the method saved therein is called.  The comments in the code below give the gist of what I would like to happen, if such is possible.  The actual application this will be applied to has many groups to add, thereby making the switch statement in the "LoadIt" method huge.  That is what I would like to avoid. Here is the fully functional test program: XAML: <Window x:Class="MethodAsParameter_01.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="Window_Loaded" Title="MainWindow" Height="350" Width="525"> <Grid> <ScrollViewer> <StackPanel Name="Root" Orientation="Vertical" ButtonBase.Click="Root_Click" /> </ScrollViewe

How to force web method to call another method by default

I want to call one method by default before each web method execution. But I don't want to add any extra code in web method.Regards, Jaydeep
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend