By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,905 Members | 2,083 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,905 IT Pros & Developers. It's quick & easy.

Include problem

P: n/a
GM
I have this include:
<!--#include file="../customer/pages/<%=request("template")%>"-->
the request("template") variable has the value = template.htm
The code above doesn't work (no html is included in the resulting page)

This one does = <!--#include file="../customer/pages/template.htm"-->

Any idea on how to solve this or a workaround?
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can't do it this way. The include is actually processed before other
inline items.

If you're using ASP.Net, you can instead put the HTML files into ASP.Net Web
User Controls. At the point you would have the include, you can have a
placeholder control. Then, in the page_load event, you can use the
Page.LoadControl() method to load the appropriate user control like so:

Control objControl = Page.LoadControl(Request("template"));

then add the user control to the placeholder

plcPlaceHolder.Controls.Add(objControl);

Of course, this only works with ASP.Net and not classic ASP.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"GM" <in*****@invalid.com> wrote in message
news:Oo****************@tk2msftngp13.phx.gbl...
I have this include:
<!--#include file="../customer/pages/<%=request("template")%>"-->
the request("template") variable has the value = template.htm
The code above doesn't work (no html is included in the resulting page)

This one does = <!--#include file="../customer/pages/template.htm"-->

Any idea on how to solve this or a workaround?

Nov 19 '05 #2

P: n/a
GM
"Mark Fitzpatrick" <ma******@fitzme.com> wrote in message
news:OM******************@TK2MSFTNGP10.phx.gbl...
You can't do it this way. The include is actually processed before other
inline items.

If you're using ASP.Net, you can instead put the HTML files into ASP.Net
Web User Controls. At the point you would have the include, you can have a
placeholder control. Then, in the page_load event, you can use the
Page.LoadControl() method to load the appropriate user control like so:

Control objControl = Page.LoadControl(Request("template"));

then add the user control to the placeholder

plcPlaceHolder.Controls.Add(objControl);

Of course, this only works with ASP.Net and not classic ASP.


Thanks,

I found a workaround using server.execute(...)

--
--------------------------------
Free software and hardware inventory for windows
http://www.lansweeper.com
Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.