Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Server tags cannot contain <% ... %> constructs

Reply
Thread Tools

Server tags cannot contain <% ... %> constructs

 
 
lm Jr
Guest
Posts: n/a
 
      05-05-2007
<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.

Thanks for help !

LMJ


 
Reply With Quote
 
 
 
 
Jon Paal [MSMD]
Guest
Posts: n/a
 
      05-05-2007
in your code for loading the page use :

SourceWindow1.FileName = [whatever]



"lm Jr" <(E-Mail Removed)> wrote in message news:O%(E-Mail Removed)...
> <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.
>
> Thanks for help !
>
> LMJ
>



 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      05-05-2007
"lm Jr" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
> <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]


 
Reply With Quote
 
lm Jr
Guest
Posts: n/a
 
      05-05-2007

Thanks for your suggestions. That was really helpful !!

LM J


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RCR: String#contain? and Array#contain? Roger Pack Ruby 3 09-28-2010 04:13 PM
Does string contain A, and if so, does a section of string contain B Jason Carlton Javascript 11 12-08-2009 06:07 PM
How can I construct an XML file to contain HTML tags in the data for a Literal element? AAaron123 ASP .Net 5 09-28-2009 05:44 PM
Parser Error Message: Server tags cannot contain <% ... %> constructs. Neil Zanella ASP .Net 1 01-12-2005 06:16 AM
Server tags cannot contain <% ... %> constructs Marcos MOS ASP .Net 5 04-15-2004 07:25 AM



Advertisments