I am using MultiView and View in .NET but i am getting this error:
Compiler Error Message: CS1061: 'ASP.default_aspx' does not contain a definition for 'NextView' and no extension method 'NextView' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)
Source Error:
|
Line 24: THIS IS VIEW 1 . HAVE A LOOK ! iTS COOL BECAUSE OF C#.<br />
Line 25: <br />
Line 26: <asp:Button ID="Button1" runat="server" Text="nEXT" OnClick="NextView" /> Line 27: <br />
Line 28: <br />
|
Source File: c:\Users\xxxx\Documents\Visual Studio 2012\Projects\WindowsAzure2\TestCRole\Default.aspx Line: 26
This is my aspx.cs code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace TestCRole
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
MultiView1.ActiveViewIndex = 0;
}
}
void NextView(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex += 1;
}
void PreView(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex += 1;
}
protected void MultiView1_ActiveViewChanged(object sender, EventArgs e)
{
}
}
}
And this is my aspx file:
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<p>
<br />
<asp:MultiView ID="MultiView1" runat="server" OnActiveViewChanged="MultiView1_ActiveViewChanged">
<asp:View ID="View1" runat="server">
THIS IS VIEW 1 . HAVE A LOOK ! iTS COOL BECAUSE OF C#.<br />
<br />
<asp:Button ID="Button1" runat="server" Text="nEXT" OnClick="NextView" />
<br />
<br />
</asp:View>
<asp:View ID="View2" runat="server">
tHIS IS TOO COOL ! iTS ALL BECAUSE OF C#.<br />
<br />
<asp:Button ID="Button2" runat="server" Text="nEXT" OnClick="NextView"/>
</asp:View>
<asp:View ID="View3" runat="server">
AND THIS IS THE END AWESOME ! tHIS ALL IS BECAUSE OF C#.<br />
<br />
<asp:Button ID="Button3" runat="server" Text="pREVIOUS" OnClick="PreView" />
<br />
<br />
</asp:View>
<br />
</asp:MultiView>
</p>
</asp:Content>
Please help me i can't understand what is the error bug !