Hide Action details at Form section

  • Thread starter Thread starter Sam Vel
  • Start date Start date
S

Sam Vel

Hello Friends

I have a site which is developed such that the aspx page which is
shown at the address bar is different from the actual page executed
but when we look at the source ALT+V->C(IE) or CTL+U the actual page
name is shown in form section

<form name="aspnetForm" method="post" action="z.aspx?N=6"
onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">

At the above code I want to Hide or change "action="z.aspx?N=6"" to
some thing different

Can anyone tell how to change that

Any ideas can also be helpfull

Regards
SamVel
 
Hello Friends

I have a site which is developed such that the aspx page which is
shown at the address bar is different from the actual page executed
but when we look at the source ALT+V->C(IE) or CTL+U the actual page
name is shown in form section

<form name="aspnetForm" method="post" action="z.aspx?N=6"
onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">

At the above code I want to Hide or change "action="z.aspx?N=6"" to
some thing different

Can anyone tell how to change that

Any ideas can also be helpfull

Regards
SamVel

<form action="javascript:redirect()">

in js

function redirect()
{
window.location = xxx;
}
 
What you doing is called URL rewriting and this is a known problem with
ASP.NET rewriting (which unfortunately is not mentioned in numerous articles
about URL rewriting)
The solution is to remember original URL before rewriting happened and then
right before rendering (in PreRender event) rewrite URL back to it.

In .NET 3.5 you can simply set the action property of the form. So you do
not need to rewire URL back.
probably something like this will work
if( this.Form != null )
this.Form.action="";

George.
 
Back
Top