|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I've been working on a dynamically generated data input page, and have the process operating OK.
I have a stored proc' that returns Xml, and this is inturn combined with an xslt so as to apply .net server controls, and it is then parsed and added to a placeholder object. My only problem at the moment is how can I apply my own custom controls in the xslt, I have tried applying another namesspace, ie, xmlns=MyControl:...., but it fails at the parsing section, complaing 'Unknown server tag' Is there some way of telling the parser to look at the registered namespaces on the main page? |
|
#2
|
|||
|
|||
|
hi mate, did you find any workaround to be able to create custom controls at runtime using xml and xslt? I am trying to do the same thing and getting the same 'Unknown server tag' error ! Please let me know if you've found any solution.
Thanks. Cheers. |
|
#3
|
|||
|
|||
|
Hi there!
I have the same problem too. But i also have no solution for this problem. Do you have figured something out meanwhile ? Thanks |
|
#4
|
|||
|
|||
|
I have tried something like this:
(I work with an XML-File, but should be the same...) XPathDocument xpdocControlsDoc = new XPathDocument( Server.MapPath( "YourXML.xml" ) ); XslTransform xsltTransform = new XslTransform(); xsltTransform.Load( Server.MapPath( "YourXSTL.xslt" ) ); StringWriter sw = new StringWriter(); xsltTransform.Transform( xpdocControlsDoc, null, sw, null); string result = "<%@ Register TagPrefix=\"YourPrefix\" Namespace=\"YourNamespace\" Assembly=\"YourAssembly\" %>"; result += sw.ToString(); Now (with the register in front of the string) i could parse the string without error message. Control ctrl = ParseControl( result ); and then add the Control to the placeholder aspphContainer.Controls.Add( ctrl ); I hope that this is what you wanted to know ? I'll have to try with it for myself a little bit. I am also in the need to dynamicly generate forms out of XML. Normaly no problem if i just work with standard asp-tags but with my own custom server controls... Cya |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Dynamic Custom-Server Controls with XML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|