CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 7/21/2004 6:14:05 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
bscoverski
Asp.Net User
TagPrefix and mulitple namespaces problem7/21/2004 6:14:05 PM

0/0

I have an assembly that contains two custom controls with two namespaces. I have added the following to assemblyInfo.cs to try and solve my problem:

[assembly:TagPrefix("MyNameSpace.abc", "abc")]
[assembly:TagPrefix("MyNameSpace.xyz", "xyz")]

If I drop the abc custom control I get the proper Register directive in my html. If I drop xyz control I also get the proper tag.

Here is my problem - the xyz control contains a collection of of object out of the abc namespace. The generated html looks like this:

<%@ Register TagPrefix="xyz" Namespace="MyNameSpace.xyz" Assembly="MyAssembly" %>

.......ect

<xyz:xyzControl id="control1" .....etc >
<Widget Size="574, 488">
<MyListOfObjectFrom_ABC>
<MyNameSpace.abc.ObjectFromABC
.......etc
</MyNameSpace.abc.ObjectFromABC>
</MyListOfObjectFrom_ABC>

If I close the web form and re-open it I get an error in the control. What I really need it to look like is this:

<%@ Register TagPrefix="xyz" Namespace="MyNameSpace.xyz" Assembly="MyAssembly" %>
<%@ Register TagPrefix="abc" Namespace="MyNameSpace.abc" Assembly="MyAssembly" %>

.......ect

<xyz:xyzControl id="control1" .....etc >
<Widget Size="574, 488">
<MyListOfObjectFrom_ABC>
<abc:ObjectFromABC
.......etc
</MyNameSpace.abc.ObjectFromABC>
</MyListOfObjectFrom_ABC>

Is there any way to get both xyz and abc Register directives when the xyz control is dropped?
bscoverski
Asp.Net User
Re: TagPrefix and mulitple namespaces problem7/21/2004 8:29:53 PM

0/0

Ok, I did figure out a work around which I'm not real happy with so if anybody has a better solution please let me know.

The work around is to create a new object in the MyNameSpace.xyz namespace that is derived off the abc namespace object. This new object is basically an empty shell. I also hade to derive a new list object off the MyListOfObjectFrom_ABC also within the xyz namespace (along with a new ui list editor).

namespace MyNameSpace.xyz
{
public class SkeltonObjectFromXYZ : MyNameSpace.abc.ObjectFromABC
{
public SkeltonObjectFromXYZ()
{
}
}
}
AndrewSeven
Asp.Net User
Re: TagPrefix and mulitple namespaces problem7/21/2004 9:07:05 PM

0/0

If you drop a control from abc onto the form, does it generate the register tag?
bscoverski
Asp.Net User
Re: TagPrefix and mulitple namespaces problem7/22/2004 2:09:11 PM

0/0

Yes, dropping a control in the abc Namespace does add the proper Register tag. The problem is that there is no way to tell the IDE to add more then one Register tag when a control is dropped.
AndrewSeven
Asp.Net User
Re: TagPrefix and mulitple namespaces problem7/23/2004 1:11:24 AM

0/0

I had understood that, I had just never tried to put more than one tag prefix in an assembly, I always think of them as "One per asssembly" ... doh!

Do you do anything special to generate the inner control?
AndrewSeven
Asp.Net User
Re: TagPrefix and mulitple namespaces problem7/23/2004 2:00:12 AM

0/0

Some old stuff I dug up:

At design time and in a designer.

controlString is the html of a control that I'd parsed out of a file, directives was hard coded string
I ended up going with the IHTMLElement brutality.

Control test = ControlParser.ParseControl(DesignerHost,controlString,directives);


IHTMLElement being used in a designer verb.

IHTMLElement copy = ((mshtml.IHTMLElement)this.DesignTimeElement);
string controlNS = ((mshtml.IHTMLElement2)this.DesignTimeElement).scopeName;
Utilities.MsgBox("AddContentContainer scopeName" + controlNS);

string source = "<{0}:ContentContainer id=\"" + controlID + "\" runat=\"server\" >Added Content Container for: {1}</{0}:ContentContainer>";
copy.innerHTML += string.Format(source,controlNS,controlID);



In your position I would probably go with the "dummy" class that inherits the real one. It may feel silly, but it works and it can be understoodby others.

bscoverski
Asp.Net User
Re: TagPrefix and mulitple namespaces problem7/23/2004 1:38:51 PM

0/0

Thanks so much for this information. I think I will probably go with the dummy control since I have it working now.
7 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
ASP.NET in a Nutshell: In a Nutshell Authors: G. Andrew Duthie, Matthew MacDonald, Pages: 979, Published: 2003
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
ASP.NET AJAX Programming Tricks Authors: Matthew David Ellis, Matthew Ellis, Pages: 388, Published: 2007
Developing Microsoft ASP.NET Server Controls and Components Authors: Nikhil Kothari, Vandana Datye, Pages: 689, Published: 2002
Webmaster's Guide to the Wireless Internet Authors: Ryan Fife, Wei Meng Lee, Pages: 0, Published: 2001
Professional ASP.NET 1.1 Authors: Alex Homer, Dave Sussman, Rob Howard, Brian Francis, Karli Watson, Richard Anderson, Pages: 1337, Published: 2004

Web:
@ Register The assembly in which the namespace associated with the tagprefix ... You can map multiple namespaces to the same tagname, as in the following example: ...
How do I change the default tagPrefix for Custom Controls? - ASP ... Also note that in v2.0, you can map multiple namespace/assembly pairs to the same tag prefix... so you could in fact use the tag prefix as ...
Multiple assemblies, one prefix in aspx page? <%@ Register Tagprefix="mysite" Namespace="MyCompany:MySite.Web" .... I had the same problem, but after stopping the 'world wide web ...
ASP.NET Resources - List Control tagPrefixes In Web.config May 26, 2006 ... use the same tagPrefix value to map to multiple assemblies or namespaces. ... It has worked so far. What problem are you experiencing? ...
TagPrefixInfo Class (System.Web.Configuration) If it is a custom control, you must define the TagPrefix, Namespace, ... The same tagPrefix value can be used to map to multiple assemblies or namespaces. ...
Multiple controls, Same name - ASP.NET Building Controls I have created multiple controls with the same name but in different namespaces (each one in a different folder) ...
ASP.NET Tutorial MobilePage" %> <%@ Register TagPrefix="mobile" Namespace="System. .... controls as needed to represent the multiple screens to be displayed. ...
Design-Time Support If you have controls in multiple namespaces, you need to use TagPrefix .... a problem, but the Properties window can also convert strings to numeric types. ...
Writing ASP.NET Web Forms with C# | O'Reilly Media To import multiple namespaces, you have to use multiple @ Import directives. ... tagprefix and tagname aliases for a server control and a user control. ...
ASP.NET Web User Controls TagPrefix: The TagPrefix determines a unique namespace for the user control. If multiple user controls on the page happen to have the same name, ...




Search This Site:










css skin solution

is this possible : get unencrypted user password using sql server not asp.net

dnn 3.1.0 german localozation is no longer available

deleting a portal problem - site settings unavailable

search input module error in dnn3

dnn 3.0.10 serializing custom objects in profile

exclude subfolder from processing by dnn

dnn3.1.0-crashed due to skin

does asp 2.0 make dnn not necessary?

admin options to add/edit module and tabs at the top of the website appears when not logged in as admin/host

adding aic e-commerce module to dnn without vs

dnn error please help

problem with events module

for help!

forums mod, what is out there?

print friendly page and parameters

session changes in dnn 3.0

sqldatareader

approach for groups and roles.

what vs.net version do i need for dnn 4.x?

portalmodulecontrol.editurl

addrow event is not firing

using icons for login in skins

error in dotnetnuke

having problems with custom control

error message opening pdfs

prevent unregister

form creator?

newbie idiot (me) deleted default portal ...

mail bouncing to [email protected]

  Privacy | Contact Us
All Times Are GMT