Re: Error messages due to conversion from older ASP.Net

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



CdnRebel via DotNetMonster.com wrote:
Hi,

I am new to ASP.Net, C# and Visual Studio 5. I have until tonight to
complete changes to a website, otherwise it gets passed on to a web
development company, if not up and running. I've made all the changes, but
with having an older version of ASP.Net and using Visual Studio 5, I am
having trouble getting a clean compile and I believe that's all that's
holding me back from loading the website changes. The above is just one of
the slew of messages I am getting on this one bit of code and I don't
understand the messages or how to fix them. It doesn't help that it's after
midnight here. The following is the code, lines 21 to 61:

namespace Furniture

{

/// <summary>

/// Summary description for AddNewProduct.

/// </summary>

// public partial class Migrated_AddNewProduct : AddNewProduct

{

protected System.Web.UI.WebControls.LinkButton lnkAddNewProduct;

protected System.Web.UI.WebControls.RequiredFieldValidator
Requiredfieldvalidator3;


protected void Page_Load(object sender, System.EventArgs e)

{

if(Session["SessionUserID"] != null)

{

lnkTopRight.Text="ADMINISTRATION";

lnkTopRight.NavigateUrl="ProductManagement.aspx";

}

else

{

lnkTopRight.Text="LOG IN";

lnkTopRight.NavigateUrl="login.aspx";

}

txtOrderNumber.Attributes.Add("OnChange", "ClientOnChange();");

int intCatID = 0;

int intSubID=0;

if(!IsPostBack)

{

if(Request["CatID"] !=null)

{

intCatID=int.Parse(Request["CatID"] .ToString());

}

if(Request["SubID"] !=null)

{

intSubID=int.Parse(Request["SubID"] .ToString());

}

LoadCategoryList(intCatID,intSubID);

}

}

The following are the errors that I got:

Error 1 A namespace does not directly contain members such as fields or
methods ...line 27 column 2

Error 2 Expected class, delegate, enum, interface, or struct ...line 28
column 13

Error 3 Expected class, delegate, enum, interface, or struct ...line 29
column 13

Error 4 Expected class, delegate, enum, interface, or struct ...line 31
column 13

Error 5 Identifier expected ...line 33 column 15

Error 6 Identifier expected ...line 51 column 16

Error 7 Identifier expected ...line 53 column 33

Error 8 A namespace does not directly contain members such as fields or
methods ...line 55 column 5

Error 9 Identifier expected ...line 55 column 16

Error 10 Identifier expected ...line 57 column 33

Error 11 Type or namespace definition, or end-of-file expected ...line 58
column 5

Error 12 The namespace 'Furniture' already contains a definition for '?' line
51 column 15

Error 13 The namespace 'Furniture' already contains a definition for '?' ...
line 53 column 32

Error 14 The namespace '<global namespace>' already contains a definition for
'?' ...line 57 column 32

Can someone please help? I was supposed to get help tonight, but he bailed
without any warning and I am working on this by myself.

The line defining the class Migrated_AddNewProduct is commented. Why is that?

Cheers,

Cliff

--

Have you ever noticed that if something is advertised as 'amusing' or 'hilarious', it usually isn't?
.



Relevant Pages

  • Error messages due to conversion from older ASP.Net
    ... C# and Visual Studio 5. ... holding me back from loading the website changes. ... Error 1 A namespace does not directly contain members such as fields or ... Error 2 Expected class, delegate, enum, interface, or struct ...line 28 ...
    (microsoft.public.dotnet.languages.csharp)
  • Convert Web-site to Web Application.
    ... I put all web pages in one namespace and all App_Code stuff ... Build and check that it works [The website after these edits]. ... The most likely cause of failure is a broken server control. ... Procede stepwise, removing code to new projects, adding references ...
    (microsoft.public.dotnet.framework.aspnet)
  • Converting VC++ 6.0 executable code to .Net DLL
    ... environment (Visual Studio 2005). ... Anyhow, the environment generated a main class for me, shown below, as ... belong to any namespace, as is just a large collection of classes developed ... What would I need to do to export my C++ interfaces? ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Error messages due to conversion from older ASP.Net
    ... If you remove the // comment from the "public partial class Migrated_AddNewProduct: AddNewProduct" line, it should get rid of most of those errors. ... Error 1 A namespace does not directly contain members such as fields or ... Error 2 Expected class, delegate, enum, interface, or struct ...line 28 ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Klassen im Verzeichnis App_Code sind nicht sichtbar
    ... ihre Methoden, es gibt keinen Namespace. ... Die Website liegt auf einem Entwicklungsserver mit IIS5 und ASP.NET 2.0. ... Gibts die Klasse denn in der Intellisense Listbox? ... Microsoft MVP - Visual Developer ASP/ASP.NET ...
    (microsoft.public.de.german.entwickler.dotnet.asp)