Namespaces and Master Pages

R

romaricr

Hello,

We are having issues with namespaces.
Here is what we do:
- We set a namespace for our project and pages (something like
'group.project.component.folder.subfolder.page)
- We add a master page to each and every pages
- When we add some controls to the page, their ID (the short one) is
not recognised by Visual Studio.

Do you have any idea what could be the problem ?

Here is a snipplet of our code:

QQ.aspx.cs (under a EPS/EPSExistant folder):

namespace Dcl.Safir.Simfi.WebUI.EPS.EPSExistant
{
public partial class QQ : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button1.Text = ??
}
}
}

QQ.aspx (under a EPS/EPSExistant folder):

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QQ.aspx.cs"
Inherits="Dcl.Safir.Simfi.WebUI.EPS.EPSExistant.QQ"
masterpagefile="~/MasterPages/MP_Test.Master" %>

<!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>

</div>
</form>
<asp:content id="Content1" runat="server"
contentplaceholderid="ContentPlaceHolder1">
<asp:button id="Button1" runat="server" text="Button"
/></asp:content>
</body>
</html>

MP_Test.master (under a MasterPages folder in the root folder)

<%@ Master Language="C#" AutoEventWireup="true"
CodeBehind="MP_Test.master.cs"
Inherits="Dcl.Safir.Simfi.WebUI.MasterPages.MP_Test" %>

<!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:ContentPlaceHolder ID="ContentPlaceHolder1"
runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>


====================

Button1 is not recognized in the code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top