N
~~~ .NET Ed ~~~
I have performed several attempts but no luck yet. I have searched the web
for days as well and nothing like that appears on any article, tutorial or
documentation. I have also looked in ASP.NET and Microsoft books and still
found no answers.
The main issue here is that I want to isolate the "look" from the "meat". So
I compose an XML string that specifies the "meat" of the control, the data,
the thing that matters. Then in order to isolate the look from the rest, I
use an XML web control to perform an XSL Transform, so basically all the eye
candy (surrounding and altering) resides in the .xslt file. So far so good,
I got that working in both run time and design time. The only complication
is that at design time the XSLT file path is very different...: This is what
happens so far:
1. I got my data D1, D2, D3
2. Prepare an XML document that has the actual data in a structured fashion.
This will be then adorned.
<Stuff><Section1>D1</Section1>...<Section3>D3</Section3></Stuff>
3. I got an XSLT file that takes the document in #2 and generates the HTML
with the eye candy
<blah blah blah>
<more HTML eye candy>
<the data>
<possibly more eye candy>
</blah-blah-HTML element>
Anyway, the problem I have now is that this composite control must also have
a series of web controls. The problem arises BECAUSE these web controls
(real ASP.NET controls) are to appear WITHIN the transformed XML:
<blah blah blah>
<more HTML eye candy>
<the data>
<webControl1/>
<webControl2/>
<possibly more eye candy>
</blah-blah-HTML element>
I have the webControl* instantiated, initialized and added
(this.Controls.Add(*)) in CreateChildControls(). Then I use something like
this:
StringWriter sw = new StringWriter();
HtmlTextWriter tw = new HtmlTextWriter(sw);
this.webControl1.RenderControl(tw);
string webControlHTML = sw.ToString();
tw.Close();
sw.Close();
and now that I have the HTML markup of the ASP.NET controls (?) I try to add
them within the XML document that is to be transformed (i.e. inserted into
the XML of #2).
The problem is.... it does not work.
I simply want to have the eye candy stuff in an XSLT file rather than
specifying it in the actual control, then I can simply change things in one
place.
As I said, I have done an extensive search, several trials but am still
stumped on this one.
for days as well and nothing like that appears on any article, tutorial or
documentation. I have also looked in ASP.NET and Microsoft books and still
found no answers.
The main issue here is that I want to isolate the "look" from the "meat". So
I compose an XML string that specifies the "meat" of the control, the data,
the thing that matters. Then in order to isolate the look from the rest, I
use an XML web control to perform an XSL Transform, so basically all the eye
candy (surrounding and altering) resides in the .xslt file. So far so good,
I got that working in both run time and design time. The only complication
is that at design time the XSLT file path is very different...: This is what
happens so far:
1. I got my data D1, D2, D3
2. Prepare an XML document that has the actual data in a structured fashion.
This will be then adorned.
<Stuff><Section1>D1</Section1>...<Section3>D3</Section3></Stuff>
3. I got an XSLT file that takes the document in #2 and generates the HTML
with the eye candy
<blah blah blah>
<more HTML eye candy>
<the data>
<possibly more eye candy>
</blah-blah-HTML element>
Anyway, the problem I have now is that this composite control must also have
a series of web controls. The problem arises BECAUSE these web controls
(real ASP.NET controls) are to appear WITHIN the transformed XML:
<blah blah blah>
<more HTML eye candy>
<the data>
<webControl1/>
<webControl2/>
<possibly more eye candy>
</blah-blah-HTML element>
I have the webControl* instantiated, initialized and added
(this.Controls.Add(*)) in CreateChildControls(). Then I use something like
this:
StringWriter sw = new StringWriter();
HtmlTextWriter tw = new HtmlTextWriter(sw);
this.webControl1.RenderControl(tw);
string webControlHTML = sw.ToString();
tw.Close();
sw.Close();
and now that I have the HTML markup of the ASP.NET controls (?) I try to add
them within the XML document that is to be transformed (i.e. inserted into
the XML of #2).
The problem is.... it does not work.
I simply want to have the eye candy stuff in an XSLT file rather than
specifying it in the actual control, then I can simply change things in one
place.
As I said, I have done an extensive search, several trials but am still
stumped on this one.