tags:

views:

125

answers:

2

I have an ASPX Page:

<%@ Page Language="C#" MasterPageFile="~/site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="myProject.Presentation.Web.Default" src="Default.aspx.cs" %>
<%@ MasterType VirtualPath="~/site.Master" %>

...

<asp:Repeater ID="rGrid" runat="server">
 <ItemTemplate>
  ...
 </ItemTemplate>
</asp:Repeater>

With this Master:

<%@ Master Language="C#" AutoEventWireup="true" Codebehind="site.master.cs" Inherits="myProject.Presentation.Web.master" src="~/site.Master.cs" %>

When I try to access one of the members on the page:

namespace myProject.Presentation.Web {
public partial class Default : System.Web.UI.Page
     ...
     rGrid.DataSource = myProject.Business.User.GetReports(UserId, true);

I get this YSOD on that line:

CS0103: The name 'rGrid' does not exist in the current context

Yet Intellisense and Object Exporer say it's valid. Why is that?

+2  A: 

Is this a website or web app?

If it's a web app, delete your designer files, then right click on your aspx page and/or master page and select convert to web app. This will rebuild the designer files.

Jack Marchetti
Web app. I usually create my web projects as Web Sites, thus this doesn't happen. That didn't work.
tsilb
A: 

This is nonsense, canned the project and redoing it as a website project.

tsilb