Click here to Skip to main content
15,901,035 members
Home / Discussions / ASP.NET
   

ASP.NET

 
NewsRe: sqlcommand.ExecuteScalar() fucntion problem Pin
Pankaj Garg14-Jan-08 19:55
Pankaj Garg14-Jan-08 19:55 
Questionhow i can solve this date problem when correct data format is is given Pin
jagan12314-Jan-08 18:22
jagan12314-Jan-08 18:22 
AnswerRe: how i can solve this date problem when correct data format is is given Pin
Pankaj Garg14-Jan-08 18:38
Pankaj Garg14-Jan-08 18:38 
GeneralRe: how i can solve this date problem when correct data format is is given Pin
jagan12314-Jan-08 18:52
jagan12314-Jan-08 18:52 
GeneralRe: how i can solve this date problem when correct data format is is given Pin
Pankaj Garg14-Jan-08 19:07
Pankaj Garg14-Jan-08 19:07 
GeneralRe: how i can solve this date problem when correct data format is is given Pin
jagan12314-Jan-08 19:13
jagan12314-Jan-08 19:13 
AnswerRe: how i can solve this date problem when correct data format is is given Pin
Pankaj Garg14-Jan-08 19:29
Pankaj Garg14-Jan-08 19:29 
GeneralSend Email Asp.net C# error Pin
bpark4414-Jan-08 18:08
bpark4414-Jan-08 18:08 
Hi,

I'm a newbie and am a little stuck.

I am attempting the "easy" task of adding a contact us user form that sends email directly to my accout.

My cs page looks like this:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;



namespace TimePlaces
{
public partial class Contact : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void txtSubmit_Click(object sender, EventArgs e)
{
MailMessage Mail = new MailMessage();
MailAddress ma = new MailAddress(txtEmail.Text, txtName.Text);
Mail.From = ma;
Mail.To.Add("info@timeplaces.com");

Mail.Subject = txtSubject.Text;
Mail.Body = txtBody.Text;

try
{
SmtpClient smtpMailobj = new SmtpClient();
smtpMailobj.Host = "localhost";
smtpMailobj.Send(Mail);
Response.Write("Your email has been sent successfully");
}
catch (Exception ex)
{
Response.Write("Message Delivery Fails");
}

}
}
}

The error I receive when I build then start w/out debugging is:

Compiler Error Message: CS0117: 'ASP.contact_aspx' does not contain a definition for 'txtSubmit_Click'

Can anyone help?

Thanks in advance.

TTG
GeneralRe: Send Email Asp.net C# error Pin
Pankaj Garg14-Jan-08 18:21
Pankaj Garg14-Jan-08 18:21 
GeneralRe: Send Email Asp.net C# error Pin
Unknown Ajanabi14-Jan-08 18:35
Unknown Ajanabi14-Jan-08 18:35 
GeneralChange Password Problem in memebership provider Pin
SreejithAchutan14-Jan-08 17:07
SreejithAchutan14-Jan-08 17:07 
GeneralRe: Change Password Problem in memebership provider Pin
SreejithAchutan14-Jan-08 18:42
SreejithAchutan14-Jan-08 18:42 
QuestionCreate a search function that search my site only Pin
VinothRao14-Jan-08 15:47
VinothRao14-Jan-08 15:47 
GeneralRe: Create a search function that search my site only Pin
Pankaj Garg14-Jan-08 17:30
Pankaj Garg14-Jan-08 17:30 
GeneralRe: Create a search function that search my site only Pin
VinothRao14-Jan-08 19:27
VinothRao14-Jan-08 19:27 
GeneralRe: Create a search function that search my site only Pin
Pankaj Garg14-Jan-08 19:45
Pankaj Garg14-Jan-08 19:45 
QuestionObjectDataSource design question Pin
imak14-Jan-08 11:27
imak14-Jan-08 11:27 
GeneralRe: ObjectDataSource design question Pin
pmarfleet14-Jan-08 11:47
pmarfleet14-Jan-08 11:47 
GeneralRe: ObjectDataSource design question Pin
ram197414-Jan-08 15:10
ram197414-Jan-08 15:10 
GeneralRe: ObjectDataSource design question Pin
imak14-Jan-08 16:11
imak14-Jan-08 16:11 
QuestionEmbeded control. Suggestions? Pin
jchalfant14-Jan-08 5:02
jchalfant14-Jan-08 5:02 
AnswerRe: Embeded control. Suggestions? Pin
Paddy Boyd14-Jan-08 5:20
Paddy Boyd14-Jan-08 5:20 
GeneralRe: Embeded control. Suggestions? Pin
jchalfant14-Jan-08 6:11
jchalfant14-Jan-08 6:11 
Generalwebserver to sql server Pin
eyeseetee14-Jan-08 4:42
eyeseetee14-Jan-08 4:42 
GeneralRe: webserver to sql server Pin
Paddy Boyd14-Jan-08 5:19
Paddy Boyd14-Jan-08 5:19 

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.