How to use asp.net Multiview control?

The Multiview control acts as a stand alone Panel like control ,or can be a container for multiple panle like control called views.Using the new multiview control with the view control allows developers an easier way to toggle between panels.


take the below example
[code]

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
MultiView1.ActiveViewIndex = 0
End Sub

Protected Sub LinkButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton2.Click
MultiView1.ActiveViewIndex = 1
End Sub

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
If txtPassword.Text <> "" And txtUsername.Text <> "" Then
Response.Redirect("")
Else
Response.Write("Enter Correct User Name and Password")
End If
End Sub

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Response.Write("Password has been sent to your mail id")
End Sub
End Class

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton ID="LinkButton1" runat="server">Login Screen</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server">Forget Password</asp:LinkButton>
<br />
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
User Name
<asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
<br />
Pass Word
<asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
<br />

<asp:Button ID="Button2" runat="server" Text="Button" />
</asp:View>
<asp:View ID="View2" runat="server">
<br />
<br />
Email ID <asp:TextBox ID="txtFEmailid" runat="server"></asp:TextBox>

<asp:Button ID="Button3" runat="server" Text="Get Password" />
<br />
</asp:View>
</asp:MultiView>
</div>
</form>
</body>
</html>



[/code]

No comments:

Post a Comment

Plz Share your comments...