It seems like that the class EmailHelperis in the namespace Comm. In order to use the method
SendMailMessage in the code behind, you can add the namespace and modify the code as follows:
protected void Button1_Click1(object sender, EventArgs e)
{
Comm.EmailHelper comm = new Comm.EmailHelper();
comm.SendMailMessage(txtEmail.Text, txtNotes);
}
Or add the namespace in the code behind as follows:
using Comm;
In addition, you need to delete the static for your method.
You can also follow aamirha's advice to call the method directly.
Best wishes,
Please mark the replies as answers if they help or unmark if not.
Feedback to us
Catherine Sh...
All-Star
23382 Points
2490 Posts
Microsoft
Re: Web form event referencing a class
Apr 25, 2012 07:27 AM|LINK
Hi fredarator,
It seems like that the class EmailHelper is in the namespace Comm. In order to use the method SendMailMessage in the code behind, you can add the namespace and modify the code as follows:
protected void Button1_Click1(object sender, EventArgs e) { Comm.EmailHelper comm = new Comm.EmailHelper(); comm.SendMailMessage(txtEmail.Text, txtNotes); }Or add the namespace in the code behind as follows:
In addition, you need to delete the static for your method.
You can also follow aamirha's advice to call the method directly.
Best wishes,
Feedback to us
Develop and promote your apps in Windows Store