Board index » Web Programming » Duplicate custom controls

Duplicate custom controls

Web Programming283
Hi!

I created some user control (ASCX) and it works fine.

The control is created one of subfolders of my project, so

its namespace looks like:

namespace myproject.subfolder1

{

public class route : System.Web.UI.UserControl

...



In another subfolder I also created second control, but

I used the 1st control as origin. Just copied the 1st control files

to the 2nd subfolder. After changed the 2nd control's namespace as:

namespace myproject.subfolder2

{

public class route : System.Web.UI.UserControl

...



Compilation works ok, but at run-time when I visit a page that contains

both of my controls, the server raises error:



Compilation Error

Description: An error occurred during the compilation of a resource required

to service this request. Please review the following specific error details

and modify your source code appropriately.

Compiler Error Message: CS1595: 'ASP.route_ascx' is defined in multiple

places; using definition from

'd:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET

Files\myproject\4b10f33a\12f97037\2bgwzy1u.dll'


-
 

Re:Duplicate custom controls

T,

Great job! You probably need to rebuild the web site to get rid of the

error. You could have just added your first control control to the second

control without copying any files to the sub folder.



Good Luck

DWS





"Tumurbaatar S." wrote:



Quote
Hi!

I created some user control (ASCX) and it works fine.

The control is created one of subfolders of my project, so

its namespace looks like:

namespace myproject.subfolder1

{

public class route : System.Web.UI.UserControl

....



In another subfolder I also created second control, but

I used the 1st control as origin. Just copied the 1st control files

to the 2nd subfolder. After changed the 2nd control's namespace as:

namespace myproject.subfolder2

{

public class route : System.Web.UI.UserControl

....



Compilation works ok, but at run-time when I visit a page that contains

both of my controls, the server raises error:



Compilation Error

Description: An error occurred during the compilation of a resource required

to service this request. Please review the following specific error details

and modify your source code appropriately.

Compiler Error Message: CS1595: 'ASP.route_ascx' is defined in multiple

places; using definition from

'd:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET

Files\myproject\4b10f33a\12f97037\2bgwzy1u.dll'









-

Re:Duplicate custom controls

The files copied really. No virtual references.

How to rebuild whole site? In the VS IDE I see only

Build my project' or rebuild it. Neither helps.

So I excluded the newly created control from the project.

After, instead of copying, I created a new empty control but

with the same name. Rebuilt it and at the runtime it raises

the same error:

Compiler Error Message: CS1595: 'ASP.route_ascx' is defined in multiple

places



May be the problem is that controls must have different names

regardless of namespace?

I.e. 'route_ascx' should be unique across the project?





"DWS" <DWS@discussions.microsoft.com>wrote in message

Quote
T,

Great job! You probably need to rebuild the web site to get rid of the

error. You could have just added your first control control to the second

control without copying any files to the sub folder.



Good Luck

DWS





"Tumurbaatar S." wrote:



>Hi!

>I created some user control (ASCX) and it works fine.

>The control is created one of subfolders of my project, so

>its namespace looks like:

>namespace myproject.subfolder1

>{

>public class route : System.Web.UI.UserControl

>....

>

>In another subfolder I also created second control, but

>I used the 1st control as origin. Just copied the 1st control files

>to the 2nd subfolder. After changed the 2nd control's namespace as:

>namespace myproject.subfolder2

>{

>public class route : System.Web.UI.UserControl

>....

>

>Compilation works ok, but at run-time when I visit a page that contains

>both of my controls, the server raises error:

>

>Compilation Error

>Description: An error occurred during the compilation of a resource

>required

>to service this request. Please review the following specific error

>details

>and modify your source code appropriately.

>Compiler Error Message: CS1595: 'ASP.route_ascx' is defined in multiple

>places; using definition from

>'d:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET

>Files\myproject\4b10f33a\12f97037\2bgwzy1u.dll'

>

>

>

>





-

Re:Duplicate custom controls

I have no idea how it helps, but I've added ClassName attribute

with different values to both ASCX's Control directive, e.g.

ClassName="ImpRoute"

in one ASCX and ClassName="ExpRoute" in other one.

Now problem disappeared.



"Tumurbaatar S." <spam_tumur@magicnet.mn>wrote in message

Quote
The files copied really. No virtual references.

How to rebuild whole site? In the VS IDE I see only

Build my project' or rebuild it. Neither helps.

So I excluded the newly created control from the project.

After, instead of copying, I created a new empty control but

with the same name. Rebuilt it and at the runtime it raises

the same error:

Compiler Error Message: CS1595: 'ASP.route_ascx' is defined in multiple

places



May be the problem is that controls must have different names

regardless of namespace?

I.e. 'route_ascx' should be unique across the project?





"DWS" <DWS@discussions.microsoft.com>wrote in message

news:9279043D-2290-4726-B5F2-4E4778214F99@microsoft.com...

>T,

>Great job! You probably need to rebuild the web site to get rid of the

>error. You could have just added your first control control to the

>second

>control without copying any files to the sub folder.

>

>Good Luck

>DWS

>

>

>"Tumurbaatar S." wrote:

>

>>Hi!

>>I created some user control (ASCX) and it works fine.

>>The control is created one of subfolders of my project, so

>>its namespace looks like:

>>namespace myproject.subfolder1

>>{

>>public class route : System.Web.UI.UserControl

>>....

>>

>>In another subfolder I also created second control, but

>>I used the 1st control as origin. Just copied the 1st control files

>>to the 2nd subfolder. After changed the 2nd control's namespace as:

>>namespace myproject.subfolder2

>>{

>>public class route : System.Web.UI.UserControl

>>....

>>

>>Compilation works ok, but at run-time when I visit a page that contains

>>both of my controls, the server raises error:

>>

>>Compilation Error

>>Description: An error occurred during the compilation of a resource

>>required

>>to service this request. Please review the following specific error

>>details

>>and modify your source code appropriately.

>>Compiler Error Message: CS1595: 'ASP.route_ascx' is defined in multiple

>>places; using definition from

>>'d:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET

>>Files\myproject\4b10f33a\12f97037\2bgwzy1u.dll'

>>

>>

>>

>>









-