Indicates that the code is separated from the logical code

Source: Internet
Author: User
Tags valid email address
Code Separation <%@ Page inherits= "MyCodeBehind" src= "C2.vb"%>

There is a nice section of the QuickStart docs on this topic also. Click here to read up on it!

This is the code

This example uses the following
Ms-sql Server 7.0 Database
Stored Procedure
Component1a.aspx (HTML File)
C2.vb
Component1a.aspx (The Page is the UI)
<%@ Page inherits= "MyCodeBehind" src= "C2.vb" debug= "true" trace= "true"%>

<script language= "VB" runat= "Server" >

Sub Page_Load (Sender as Object, E as EventArgs)

Response.Write ("SMILE!!! I Love learning new Things Everyday ")

End Sub
</script>


<title>component Page 1</title>
<body>
<table border=0 cellpadding=3 cellspacing=3>
<tr bgcolor= "#CCCCCC" >
<td>
<font face= "Arial, Helv" size= "-1" >
Please fill out the form to create a new user profile for your
Company ' s Component.
<br>
Once This information are gathered you won't need to enter it again and you are able to update anytime.
<p>
Use the button in the bottom of this page to continue when you are finished.
<br>
</font>
</td>
</tr>
</table>

<font size= "+1" ><b><font color= "#ff0000" >*=required fields</b><br>

<form method= "Post" Name= "Form1" runat= "Server" >
<table> <tr>
&LT;TD align=right>
<asp:label id= "Label1" text= "Company Name" Font-name= "Verdana" font-size= "10pt" width= "200px" borderstyle= "solid" Bordercolor= "#cccccc" runat= "Server"/>
</td>
<td>
<asp:textbox id= "CompanyName" size= runat= "Server"/>
<asp:requiredfieldvalidator controltovalidate= "CompanyName" display= "Dynamic" errormessage= "You must enter your name! "runat=server/>
</td>
</tr>
<tr>
&LT;TD align=right>
<asp:label id= "Label2" text= "Company URL" Font-name= "Verdana" font-size= "10pt" width= "200px" borderstyle= "solid" Bordercolor= "#cccccc" runat= "Server"/>
</td>
<td>
<asp:textbox id= "Companyurl" size= runat= "Server"/>
</td>
</tr>

</font>
<tr>
&LT;TD align=right>
<asp:label id= "Label3" text= "Contact Email" font-name= "Verdana" font-size= "10pt" width= "200px" borderstyle= "solid" Bordercolor= "#cccccc" runat= "Server"/>
</td>
<td>
<asp:textbox id= "EmailAddress" size= "runat=" "Server" maintainstate= "false"/>
<asp:regularexpressionvalidator controltovalidate= "EmailAddress" validationexpression= "[\w-]+@[\w-]+\. (com|net|org|edu|mil) "display=" Dynamic "font-name=" Verdana "font-size=" 9pt "errormessage=" must use a valid email Address. "runat=" Server > </asp:RegularExpressionValidator>
<asp:requiredfieldvalidator controltovalidate= "EmailAddress" display= "dynamic" font-name= "Verdana" 9pt "errormessage=" ' Email ' must not being left blank. "Runat=server> </asp:RequiredFieldValidator> </td>
</tr>
</table>

<table border=0 bgcolor= "#CCCCCC" cellpadding=3 cellspacing=3 width= "490" >
<tr>
&LT;TD width= "100%" colspan= "2" >
<asp:button id= "Button1" text= "Create profile" onclick= "Button1_Click" runat= "Server"/>
</td>
</tr>
</table>
</form>

</body>




C2.vb file (this file Contains the business logic which is inherited just like a compiled DLL
Option Strict off

Imports System
Imports System.DateTime
Imports System.Globalization
Imports System.Data
Imports System.Data.SQL
Imports System.Web.UI
Imp



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.