ASP.Net/Mobile Control/Compare Validator

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Mobile Compare validator (VB.net)

<%@ Page 
    Inherits="System.Web.UI.MobileControls.MobilePage" 
    Language="VB" 
%>
<%@ Register 
    TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" 
%>
<script runat="server" language="VB">
Sub OK_OnSubmit(Sender As Object, E As EventArgs)
    If Page.IsValid Then
        ActiveForm = FinishForm
        lbl2.Text = "You entered " & txt1.Text
    End If
End Sub
</script>
<mobile:form 
    id="StartForm" 
    runat="server">
    <mobile:label 
        runat="server" 
        id="lbl1"
        Text="Enter the same word twice:" 
    />
    <mobile:textbox
        runat="server" 
        id="txt1"
    />
    <mobile:textbox
        runat="server" 
        id="txt2"
    />
    <mobile:comparevalidator 
        id="cvCheckText" 
        controltovalidate="txt1"
        controltocompare="txt2"
        errormessage="ENTER THE SAME TEXT TWICE!!!"
        runat="server"
    />
    <mobile:Command 
        runat="server" 
        id="cmdOK"
        OnClick="OK_OnSubmit" 
        Text="OK" 
    />
</mobile:form>
<mobile:form 
    id="FinishForm" 
    runat="server">
    <mobile:label 
        runat="server" 
        id="lbl2"
    />
</mobile:form>