Can't use namespaces for ASP.NET pages...
-
Hello, I am getting a strange problem in my projects (ASP.NET/C#), whenever I try to put the classes into a namespace, an error is generated saying that it cannot resolve the symbol i.e.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
works fine, but
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyNamespace.MyPage" %>
doesn't! any ideas why this might be happening? Warmest Regards,
- A programmer's national anthem; "AAAAAHHHHH!!!!"
-
Hello, I am getting a strange problem in my projects (ASP.NET/C#), whenever I try to put the classes into a namespace, an error is generated saying that it cannot resolve the symbol i.e.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
works fine, but
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyNamespace.MyPage" %>
doesn't! any ideas why this might be happening? Warmest Regards,
- A programmer's national anthem; "AAAAAHHHHH!!!!"
-
Hello, I am getting a strange problem in my projects (ASP.NET/C#), whenever I try to put the classes into a namespace, an error is generated saying that it cannot resolve the symbol i.e.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
works fine, but
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyNamespace.MyPage" %>
doesn't! any ideas why this might be happening? Warmest Regards,
- A programmer's national anthem; "AAAAAHHHHH!!!!"
Code file contains the Code Behind file name for your aspx page And in the Inherits property you should give full name of your code behind class including the namespace that you have for your project i think you are working in VS 2005 and you added a namespace for your application
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
-
Does the code behind look something like this?
using System; using System.Data; namespace MyNamespace { public class MyPage : System.Web.UI.Page { private void Page_Load(object sender, System.EventArgs e) {
-
Code file contains the Code Behind file name for your aspx page And in the Inherits property you should give full name of your code behind class including the namespace that you have for your project i think you are working in VS 2005 and you added a namespace for your application
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
-
Thanks, and yes it is so, but what is the fix? :)
- A programmer's national anthem; "AAAAAHHHHH!!!!"
That i can't say where have you gone wrong Did you give same namespace for all classes in the application or can you post your namespace and class name
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
-
That i can't say where have you gone wrong Did you give same namespace for all classes in the application or can you post your namespace and class name
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
Yes, it's like (NOTE: I am typing it by hand (as the code is not in my laptop right now), so please ignore any syntax errors )
namespace LSW
{
class SignUp : System.Web.UI.Page
{
...........
...........and I trying to access it with
inherits="LSW.SignUp"
which throws unresolved symbol error. strangely enough, as soon as I remove the namespace (from both the class and theinherits
attribute), the code starts to work... Warmest Regards,- A programmer's national anthem; "AAAAAHHHHH!!!!"
-
Yes, it's like (NOTE: I am typing it by hand (as the code is not in my laptop right now), so please ignore any syntax errors )
namespace LSW
{
class SignUp : System.Web.UI.Page
{
...........
...........and I trying to access it with
inherits="LSW.SignUp"
which throws unresolved symbol error. strangely enough, as soon as I remove the namespace (from both the class and theinherits
attribute), the code starts to work... Warmest Regards,- A programmer's national anthem; "AAAAAHHHHH!!!!"
Yes it happenes many times in 2005 you have partial class and class will not put in any namespace by default see the code
namespace MyNameSpace { public partial class ForumTest : System.Web.UI.Page { int a = 0; string[] str ={ "January", "February", "March", "April" }; strin
and aspx page contains<%@ Page Language="C#" EnableViewState="true" AutoEventWireup="true" CodeFile="ForumTest.aspx.cs" Inherits="MyNameSpace.ForumTest" %>
see all properties are rigth set Again i alsp don't have answer to this but when i added namspace in my application it is rumming fine although i faced same problem few months before . No sooner did i got the answer i will let yoy know if you have do the sameThanks and Regards Sandeep If you want something you never had, do something you have never done!
-
Yes it happenes many times in 2005 you have partial class and class will not put in any namespace by default see the code
namespace MyNameSpace { public partial class ForumTest : System.Web.UI.Page { int a = 0; string[] str ={ "January", "February", "March", "April" }; strin
and aspx page contains<%@ Page Language="C#" EnableViewState="true" AutoEventWireup="true" CodeFile="ForumTest.aspx.cs" Inherits="MyNameSpace.ForumTest" %>
see all properties are rigth set Again i alsp don't have answer to this but when i added namspace in my application it is rumming fine although i faced same problem few months before . No sooner did i got the answer i will let yoy know if you have do the sameThanks and Regards Sandeep If you want something you never had, do something you have never done!