Nov 09, 2014, 5:52 PM
Change MultiView active view using ext:button
Hello,
I have a Multiview with two views. Two buttons (one linkbutton and one ext:button) are placed into View1, both should change active view to View2 when clicked. The LinkButton works, the Ext button doesn't. What I've missed here?
Regards
Alex
I have a Multiview with two views. Two buttons (one linkbutton and one ext:button) are placed into View1, both should change active view to View2 when clicked. The LinkButton works, the Ext button doesn't. What I've missed here?
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void LinkButton1_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
</script>
<!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></title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<form id="form1" runat="server">
<div>
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
<p>This is View 1</p>
<p><asp:LinkButton ID="lbtn1" runat="server" OnClick="LinkButton1_Click" Width="145" Height="145" BorderStyle="Solid">
<span>LinkButton Goto View 2 Works</span></asp:LinkButton></p>
<p><ext:button Height="145px" Width="145px" runat="server" ID="lbtn2" Text="Ext Button Goto View 2<br/>Doesn't Work"
Scale="Large" LabelWidth="120" OnDirectClick="LinkButton1_Click" /></p>
</asp:View>
<asp:View ID="View2" runat="server">
<p>This is View 2</p>
<p><asp:LinkButton ID="lbtnBack" runat="server" OnClick="LinkButton2_Click" Width="145" Height="145" BorderStyle="Solid">
<span>Back to View 1</span></asp:LinkButton></p>
</asp:View>
</asp:MultiView>
</div>
</form>
</body>
</html>
Thank youRegards
Alex