I am making a Contact page for a website using ASP.NET. In my aspx file there are a few textboxes. When I try to refer to these textboxes in script by their id's, it says that they are not declared. What am I doing wrong and how can I get this script to work?

VB Code:
  1. dim Mname as string
  2. dim Mphone as string
  3. dim Memail as string
  4. dim Mmessage as string
  5.  
  6. Public Sub Post
  7.  
  8. 'There are textboxes on the form with the id's Name, Email, Phone and Message
  9. 'Here I need to Say that Mname = Name.text... excetera. But it doesnt work
  10.  
  11. Nname = Name.text
  12.  
  13.  
  14. ' Build a MailMessage
  15. Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
  16. mailMessage.From = "[email protected]"
  17. mailMessage.To = "[email protected]"
  18. mailMessage.Subject = "Contact Form Results"
  19. mailMessage.BodyFormat = System.Web.Mail.MailFormat.Html
  20. mailmessage.Body  = Mmessage
  21.  
  22. ' TODO: Set the mailMessage.Body property
  23.  
  24. System.Web.Mail.SmtpMail.SmtpServer = "localhost"
  25. System.Web.Mail.SmtpMail.Send(mailMessage)
  26.  
  27.  
  28.  
  29. end sub