473,587 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_a scx' is defined in multiple
places;"
I know that I have two controls EditForm, in different namespaces, but with
same file name: "EditForm_a scx"

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

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

<%@Control ClassName="Edit Form" ... %>

<%@ 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****@discuss ions.microsoft. com> wrote in message
news:EA******** *************** ***********@mic rosoft.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_a scx' is defined in multiple
places;"
I know that I have two controls EditForm, in different namespaces, but
with
same file name: "EditForm_a scx"

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_a scx' is defined in
multiple places;"
I know that I have two controls EditForm, in different namespaces,
but with same file name: "EditForm_a scx"

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
2786
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 IDs. Thanks Vivek
6
11274
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" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
1
2990
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 inside the web form using fnCalendar1.getInfo(), the source code does not even compile with the error message "fnCalendar1" is not declared. I looked...
1
1342
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 right now, I save schedule.ascx as another name, say schedule2.ascx then I go to code behind and chane the class name and the methods I like to...
0
998
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 id="Prevbutton" onclick="PagerButton_Click" runat="server" Text="" CommandArgument="Prev"></asp:linkbutton> and i have code behind like this
2
4809
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 required: <%@ Register TagPrefix="UC" TagName="MyUserCtrl" Src="MyUC.ascx" %> Assuming that the ASPX page doesn't use a code-behind, I can access the...
1
3500
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 javascript code and how to call its function .please help me its urgent and suggest me any idea about this query...... Thanks & Regards Amit
1
2843
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'); background-position:center; background-repeat:no- repeat;" <!-- My footer content goes here. --</div> This Footer.ascx is under a folder called /UserControls (the leading...
4
2474
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 unsuccessfully in creating the whole pane as a user control and have succeeded in adding the pane and then dynamically adding the content which is a user...
0
7923
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8216
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7974
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8221
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5719
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.