"lm Jr" <lm**@aspdotnet.learnerwrote in message
news:O%****************@TK2MSFTNGP04.phx.gbl...
<cc:SourceWindow id="SourceWindow1"
FileName="<%=Request.ServerVariables["PATH_INFO"]%>" RunAt="server" >
The above produces the following error:
Server tags cannot contain <% ... %constructs.
Any idea, what to do here? I am an old ASP programmer.
In your Page_Load method, do this:
SourceWindow1.FileName = Request.ServerVariables["PATH_INFO"]
I strongly suggest you never use the technique you tried above. Substituting
directly into the rendered HTML can cause problems. For example, I've been
fighting today with user controls that do things like this:
<script language="javascript">
function Something()
{
var control = document.getElementById("<%= _someControl.ClientID %>");
}
</script>
This innocent piece of script causes one copy of itself to be created for
each instance on a page of the control containing it. Not a problem if the
script is small and there are few instances, but on one of our pages, each
script block is about 750 lines long, and there are over 10 instances of the
control on the same page. It adds up.
Good luck with ASP.NET. Please feel free to ask for help on these
newsgroups, and please try to learn the .NET way of doing things - there's a
reason why ASP.NET was invented, and that reason is ASP!
--
John Saunders [MVP]