How access other project classes

S

Sala

Hi experts!

I have two projects ...

so First project cs code like this,

using System;
using System.Collections;
using System.Configuration;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.IO;
using GotDotNet.XInclude;
using com.kikudjiro;
using EwaoListingCommon;

namespace Cititown
{
/// <summary>
/// Summary description for Compose.
/// </summary>
public class Compose : CommonPage
{
protected System.Web.UI.HtmlControls.HtmlInputHidden hAction;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPage;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPagesCount;
protected System.Web.UI.HtmlControls.HtmlInputHidden hOrderField;
protected System.Web.UI.HtmlControls.HtmlInputHidden hOrderDir;
protected System.Web.UI.HtmlControls.HtmlInputHidden hCatID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hSubCatID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hListerID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hType;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPostingID;

private void Page_Load ( object sender, EventArgs e )
{
bool bFileRemoved = false;
bool bCantSaveAttachment = false;
bool bNoSpace = false;
}
]
}

Second project code like this,

using System;
using System.Collections;
using System.Configuration;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.IO;
using GotDotNet.XInclude;
using com.kikudjiro;
using EwaoListingCommon;

namespace Cititown.myemails
{
/// <summary>
/// Summary description for Compose.
/// </summary>
public class ListingComposeGraphic : XmlPage
{
protected System.Web.UI.HtmlControls.HtmlInputHidden hAction;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPage;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPagesCount;
protected System.Web.UI.HtmlControls.HtmlInputHidden hOrderField;
protected System.Web.UI.HtmlControls.HtmlInputHidden hOrderDir;
protected System.Web.UI.HtmlControls.HtmlInputHidden hCatID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hSubCatID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hListerID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hType;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPostingID;

private void Page_Load ( object sender, EventArgs e )
{
bool bFileRemoved = false;
bool bCantSaveAttachment = false;
bool bNoSpace = false;
}
}
}

If I am using like this

using System;
using System.Collections;
using System.Configuration;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.IO;
using GotDotNet.XInclude;
using com.kikudjiro;
using EwaoListingCommon;

namespace Cititown.myemails
{
/// <summary>
/// Summary description for Compose.
/// </summary>
public class ListingComposeGraphic : XmlPage , CommonPage ( I add
here! )
{
protected System.Web.UI.HtmlControls.HtmlInputHidden hAction;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPage;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPagesCount;
protected System.Web.UI.HtmlControls.HtmlInputHidden hOrderField;
protected System.Web.UI.HtmlControls.HtmlInputHidden hOrderDir;
protected System.Web.UI.HtmlControls.HtmlInputHidden hCatID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hSubCatID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hListerID;
protected System.Web.UI.HtmlControls.HtmlInputHidden hType;
protected System.Web.UI.HtmlControls.HtmlInputHidden hPostingID;

private void Page_Load ( object sender, EventArgs e )
{
bool bFileRemoved = false;
bool bCantSaveAttachment = false;
bool bNoSpace = false;
}
}
}
I got error message pls help me soon
 
M

Marc Gravell

Unless you actually go to the trouble of telling people what error you get
(exact text), and when (runtime / compile-time), I doubt many people are
going to bother trying to infer...

Marc
 
S

Sala

Hi experts!

I have two projects ...


so First project cs code like this,
===========================


using System;
using EwaoListingCommon;


namespace Cititown
{
/// <summary>
/// Summary description for Compose.
/// </summary>
public class Compose : CommonPage
// SEE HERE
{
protected System.Web.UI.HtmlControls.HtmlInputHidden
hPostingID;

private void Page_Load ( object sender, EventArgs e )
{
bool bFileRemoved = false;
}
}
}


Second project code like this,
======================

using System;
using EwaoListingCommon;


namespace Cititown.myemails
{
/// <summary>
/// Summary description for Compose.
/// </summary>
public class ListingComposeGraphic : XmlPage
// SEE
HERE
{
protected System.Web.UI.HtmlControls.HtmlInputHidden
hAction;


private void Page_Load ( object sender, EventArgs e )
{
bool bFileRemoved = false;
}
}
}


If I am using like this
==================

using System;
using EwaoListingCommon;


namespace Cititown.myemails
{
/// <summary>
/// Summary description for Compose.
/// </summary>
public class ListingComposeGraphic : XmlPage , CommonPage
// SEE HERE
{
protected System.Web.UI.HtmlControls.HtmlInputHidden
hPostingID;


private void Page_Load ( object sender, EventArgs e )
{
bool bFileRemoved = false;
}
}
}


I got error like this is not type of interface
 
M

Marc Gravell

I suspect that you are attempting multiple inheritance, which isn't
supported in C# (or .Net AFAIK); ListingComposeGraphic can inherit from one
or the other, but not both.

But! don't tell us something *like* the error message. Just copy / paste. It
will be less typing, and might actually tell us the problem!!!
</rant>

Marc
 
S

Sala

I got error msg when am compiling...
Error :
C:\Inetpub\wwwroot\Cititown\ListingComposeGraphic.aspx.cs(26):
'CommonPage' : type in interface list is not an interface
 
C

Christof Nordiek

Hi Sala,

C# doesn't support multiple inheritance for classes.

in the line:
public class ListingComposeGraphic : XmlPage , CommonPage

you try to inherit from 2 classes. That's not posseble.

If CommonPage were an interface, this would be possible. That's why the
compiler says 'this is not type of interface'
 
M

Marc Gravell

See other post; you're currently attempting to use multiple inheritance. I
can't answer tell you the correct way of accessing it unless you can clarify
what you are trying to do... it really isn't very clear, sorry.

Marc
 

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

Top