L
Lars
Hi
I fear that I have stumbled on to a bug in VS2008. I have controlls added to
a page that is within a MasterPage and when I try to access the controls
from the .cs file the compiler doesn't recognize the control members.
I have this in my aspx file.
<asp:LoginView ID="lvMP3URL" runat="server">
<LoggedInTemplate>
<asp:FormView ID="fvMP3URL" runat="server" AllowPaging="True"
BackColor="White"
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px"
CellPadding="3"
CellSpacing="1" DataKeyNames="URL" DataSourceID="sdsMP3Files">
<FooterStyle BackColor="#B4B4B4" ForeColor="Black" />
<RowStyle BackColor="#B4B4B4" ForeColor="Black" />
<EmptyDataRowStyle BackColor="#B4B4B4" ForeColor="Black" />
<InsertRowStyle BackColor="#B4B4B4" ForeColor="Black" />
<RowStyle BackColor="#B4B4B4" ForeColor="Black" />
<PagerStyle BackColor="#B4B4B4" ForeColor="Black" />
<!--Mmore defines
..
..
..
-->
</asp:FormView>
<asp:GridView ID="gvMP3URL" runat="server" AllowPaging="True"
AllowSorting="True" BackColor="White" BorderColor="White"
BorderStyle="Ridge"
BorderWidth="2px" CellPadding="3" CellSpacing="1"
DataSourceID="sdsMP3Files"
GridLines="None">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
</Columns>
<PagerStyle BackColor="#B4B4B4" Font-Bold="True" ForeColor="Black"
HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#B4B4B4" Font-Bold="True" ForeColor="Black" />
<HeaderStyle BackColor="#B4B4B4" Font-Bold="True" ForeColor="Black" />
</asp:GridView>
</AnonymousTemplate>
</asp:LoginView>
The following code can't be compiled
protected void gvMP3URL_SelectedIndexChanged(object sender, EventArgs e)
{
fvMP3URL.PageIndex = gvMP3ULR.PageIndex;
}
I get the error2
Error 49 The name 'fvMP3URL' does not exist in the current context
Error 50 The name 'gvMP3ULR' does not exist in the current context
Can some one explain why?
Lars
I fear that I have stumbled on to a bug in VS2008. I have controlls added to
a page that is within a MasterPage and when I try to access the controls
from the .cs file the compiler doesn't recognize the control members.
I have this in my aspx file.
<asp:LoginView ID="lvMP3URL" runat="server">
<LoggedInTemplate>
<asp:FormView ID="fvMP3URL" runat="server" AllowPaging="True"
BackColor="White"
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px"
CellPadding="3"
CellSpacing="1" DataKeyNames="URL" DataSourceID="sdsMP3Files">
<FooterStyle BackColor="#B4B4B4" ForeColor="Black" />
<RowStyle BackColor="#B4B4B4" ForeColor="Black" />
<EmptyDataRowStyle BackColor="#B4B4B4" ForeColor="Black" />
<InsertRowStyle BackColor="#B4B4B4" ForeColor="Black" />
<RowStyle BackColor="#B4B4B4" ForeColor="Black" />
<PagerStyle BackColor="#B4B4B4" ForeColor="Black" />
<!--Mmore defines
..
..
..
-->
</asp:FormView>
<asp:GridView ID="gvMP3URL" runat="server" AllowPaging="True"
AllowSorting="True" BackColor="White" BorderColor="White"
BorderStyle="Ridge"
BorderWidth="2px" CellPadding="3" CellSpacing="1"
DataSourceID="sdsMP3Files"
GridLines="None">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
</Columns>
<PagerStyle BackColor="#B4B4B4" Font-Bold="True" ForeColor="Black"
HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#B4B4B4" Font-Bold="True" ForeColor="Black" />
<HeaderStyle BackColor="#B4B4B4" Font-Bold="True" ForeColor="Black" />
</asp:GridView>
</AnonymousTemplate>
</asp:LoginView>
The following code can't be compiled
protected void gvMP3URL_SelectedIndexChanged(object sender, EventArgs e)
{
fvMP3URL.PageIndex = gvMP3ULR.PageIndex;
}
I get the error2
Error 49 The name 'fvMP3URL' does not exist in the current context
Error 50 The name 'gvMP3ULR' does not exist in the current context
Can some one explain why?
Lars