N
Neil Zanella
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
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