<%@ Page
Inherits="System.Web.UI.MobileControls.MobilePage"%>
<%@ Register TagPrefix="Mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<script runat="server">
Sub Page2(Sender as Object,E as EventArgs)
If Page.IsValid Then
ActiveForm=f2
txt2.Text="Your username is: " & txt1.text
end if
End Sub
Sub user(source As object,args As ServerValidateEventArgs)
if len(args.Value)<8 or len(args.Value)>16 then
args.IsValid=false
else
args.IsValid=true
end if
End Sub
</script>
<Mobile:Form id="f1" runat="server">
<Mobile:Label runat="server">
Please enter a username
</Mobile:Label>
<Mobile:TextBox id="txt1" runat="server" />
<Mobile:CustomValidator runat="server"
ControlToValidate="txt1"
OnServerValidate="user"
Text="A username must be between 8 and 16 characters!" />
<Mobile:Command OnClick="Page2" runat="server">
Submit</Mobile:Command>
</Mobile:Form>
<Mobile:Form id="f2" runat="server">
<Mobile:Label id="txt2" runat="server" />
</Mobile:Form>
|