Parser Error Message: Server tags cannot contain <% ... %> constructs.
From: Neil Zanella (nzanella_at_cs.mun.ca)
Date: 01/12/05
- Next message: Patrick.O.Ige: "Re: ASP.NET 2.0"
- Previous message: tshad: "Re: Class not working for textbox."
- Next in thread: Philip Q [MVP]: "Re: Parser Error Message: Server tags cannot contain <% ... %> constructs."
- Reply: Philip Q [MVP]: "Re: Parser Error Message: Server tags cannot contain <% ... %> constructs."
- Messages sorted by: [ date ] [ thread ]
Date: 11 Jan 2005 17:38:35 -0800
Hello,
I would like to do the following:
<form method="post"
action="<%= Request.ServerVariables["URL"] %>"
runat="server">
The reason I would like to do this is twofold:
1. I want my page to be such that when I post I get
rid of the query string appended at the end of the URL.
2. I want my code to be such that when I rename the file that
containins it I don't have to change the name of the .aspx
file in all enclosed action fields.
In PHP, this would have been possible using the PHP_SELF variable.
However, when using ASP.NET, IIS issues the following error message,
which is unfortunate (should I say stupid, given that PHP can do it):
Parser Error Message: Server tags cannot contain <% ... %> constructs.
I wonder why ASP.NET would impose this restriction, and wonder if there
is a workaround for this problem in ASP.NET.
Suggestions welcome,
Best Regards,
Neil
- Next message: Patrick.O.Ige: "Re: ASP.NET 2.0"
- Previous message: tshad: "Re: Class not working for textbox."
- Next in thread: Philip Q [MVP]: "Re: Parser Error Message: Server tags cannot contain <% ... %> constructs."
- Reply: Philip Q [MVP]: "Re: Parser Error Message: Server tags cannot contain <% ... %> constructs."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|