Stò creando un form di iscrizione nel quale i campi contrassegnati con l'asterisco sono obbligatori,il codice è il seguente e mi dice nella seguente riga: if tbEmail.Text = " " then
che il nome "tbEmail" non è dichiarato.Da che deriva ciò?
<%@ Page Language="VB" %>
<script runat="server">
sub Submit(obj as object,e as eventargs)
if tbName.Text = " " then
lblMessage.Text = "You forgot your name!
"
end if
if tbPhone.Text = " " then
lblMessage.Text += "You forgot your phone!
"
end if
if tbEmail.Text = " " then
lblMessage.Text += "You forgot your email!
"
end if
if lblMessage.Text = " " then
lblMessage.Text = "You information has been! " & _
"submitted!"
end if
end sub
</script>
<html><body>
Please enter the follwing information.
<asp:Label id="lblMessage" runat="server"/>
<form runat="server">
<table cellpadding="2" cellspacing="2" border="1">
<tr>
<td widht="250">Name* </td>
<td widht="150">
<asp:TextBox id="tbName" runat="server"/>
</td>
</tr>
<td>Address</td>
<td>
<asp:TextBox id="tbAddress" runat="server"/>
</td>
</tr>
<tr>
<td>Phone*</td>
<td>
<asp:TextBox id="tbPhone" runat="server"/>
</td>
</tr>
<tr>
<td>Fax</td>
<td>
<asp:TextBox id="tbFax" runat="server"/>
</td>
</tr>
<tr>
<td>Mail*</td>
<td>
<asp:TextBox id="tbMail" runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button id="btSubmit" runat="server"
Text="Submit"
OnClick="Submit" />
</td>
</tr>
</table>
An Asterisk (*) indicates a required field.
</form>
</html></body>

Rispondi quotando