473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Can two Web User Control have same File (.ascx) name within projec

Hello
I'm asking is it possible that two or more Web User Control have same file
(.ascx) name within same project? Namespace is different.

I got error message: "CS1595: 'ASP.EditForm_ascx' is defined in multiple
places;"
I know that I have two controls EditForm, in different namespaces, but with
same file name: "EditForm_ascx"

If it is of any importance, I use both user controls on same page.

Thanks
MilanB
Nov 19 '05 #1
3 1663
In the @control directive, try to specify a separate classname for each..

<%@Control ClassName="EditForm" ... %>

<%@ Control ClassName="Blah" ... %>

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"MilanB" <Mi****@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
Hello
I'm asking is it possible that two or more Web User Control have same file
(.ascx) name within same project? Namespace is different.

I got error message: "CS1595: 'ASP.EditForm_ascx' is defined in multiple
places;"
I know that I have two controls EditForm, in different namespaces, but
with
same file name: "EditForm_ascx"

If it is of any importance, I use both user controls on same page.

Thanks
MilanB

Nov 19 '05 #2
MilanB wrote:
Hello
I'm asking is it possible that two or more Web User Control have same
file (.ascx) name within same project? Namespace is different.

I got error message: "CS1595: 'ASP.EditForm_ascx' is defined in
multiple places;"
I know that I have two controls EditForm, in different namespaces,
but with same file name: "EditForm_ascx"

If it is of any importance, I use both user controls on same page.

Thanks
MilanB


Yes, that is possible. You can have a classname appear in multiple
namespaces. In fact, that's the reason (or at least one of them)
to *have* namespaces.
Did you copy the first EditForm to get the second? You need to change
that namespace in two places: the codebehind *and* in the
<% @ Control %> directive.

Hans Kesting
Nov 19 '05 #3
I have tried, but it has not worked.
It is not a problem with namespace, but same file (.ascx) name.
When I give it different .ascx name, it works fine, no matter class names
are same (of course in different namespaces).

Any way thanks

I will give unique .ascx name.
MilanB

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Vivek Sharma | last post by:
Hi, I have created a dropdownlist as a web user control. I am using its multiple instances on the webpage. How do I access the selectedValue of each instance? All the instances have different...
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
1
by: Ed Chiu | last post by:
Hi, I createed a user control named fnCalender.ascx, there is a method called getInfo defined in calender.ascx. I drag and drop this control into a web form then I tried to call the method...
1
by: Danny Ni | last post by:
Hi, I have one user control named Schedule.ascx, I want to create another control which is quite similar to schedule.ascx but differs in some methods and some UI elements, the way I am doing it...
0
by: ferryandi | last post by:
hi i created a linkbutton with this code in html <asp:linkbutton id="Nextbutton" onclick="PagerButton_Click" runat="server" Text="" CommandArgument="Next"></asp:linkbutton> <asp:linkbutton...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
1
by: amitsaxena1981 | last post by:
hi, I m creating gridview user control with asp.net2.0 and vb.net.Now i want to apply the some javascript function and html tags in gridview user control.I dont know where i put this...
1
by: gnewsgroup | last post by:
I have a user control called Footer.ascx, in which a background image is inserted like so: <div id="footerdiv" style="background-image:url('Images/ mybackground.jpg');...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.