protected void lnkForward_Click(object sender, EventArgs e)
{
try
{
string UserName=Session["UserName"].ToString();
string url = "~/Page2/" +UserName;
Response.Redirect(url, false);
}
catch (Exception)
{
throw;
}
}
in Web.config
="1.0"
<configuration>
<configSections>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
</configSections>
<system.web>
<urlMappings enabled="true">
<add url="~/Static-Page" mappedUrl="~/Static.aspx" />
</urlMappings>
<httpModules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
</httpModules>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
<rewriter>
<rewrite url="~/Page/(.+)" to="~/Page2.aspx?User=$1"/>
</rewriter>
</configuration>
Add to DDL to the BIN
Intelligencia.UrlRewriter.dll