Recent Lessons

Search

Rss Lessons

Rss Blog

 

Contact Form Asp.Net Control

This control provide an easy way to present the often used "contact" or "feedback" form.

Your name:
Your email:
Subject:
Comment:

The contact form controls creates a "standard contact form" that is found on pretty much every single website.  The idea is to encapsulate this standard element in a single server control - in a similar way to the login control does for login / membership functions.

The form element labels and styles can be modified.  You can also choose to include a subject field or not.  Collecting the values of the form is then pretty easy.

The code for instantiating the contact form control is:


<RO:ContactForm ID="mystuff" ShowSubject="true" runat="server"></RO:ContactForm> 
 



To get the values of the form, you need to create an event handler for the "submitContactForm" event.

For example:
  Sub sendEmail() Handles mystuff.submitContactForm  
 
        Response.Write(mystuff.nameField)  
        Response.Write(mystuff.emailField)  
        Response.Write(mystuff.commentField)  
 
 
    End Sub 

You can change the "labels" for the various form fields using properties such as "EmailLabelText".
 

Free Web Development Courses

  • 1

Privacy Policy