You must Sign In to post a response.
  • Category: .NET

    Redirect when file extention is aspx (web.conf)

    I want to redirect the url when the file extention is .aspx file to a new url, how can i do this?
  • #765418
    on which event you want to redirect ? Please elaborate your problem so that we can help you better to resolve your point.
    What you have tried so far ?

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765429
    I want to redirect when my page load itself, because those pages are removed and I want to redirect those links to other site.

  • #765430
    Use Response object, on page load you can use following code
    Response.Redirect("testpage.aspx");

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765475
    I did n't get the exact problem ; My understanding is you want to redirect the aspx page so use Response.Redirect or server.Transfer any thing or you can do urlrewriting in webconfig,
    SRI RAMA PHANI BHUSHAN KAMBHAMPATI

  • #765751
    Use Response.Redirect to redirect the user to another page in the if condition specifying if it is not a postback. For example:
    if(!isPostBack())
    {
    Response.Redirect("Page1.aspx");
    }

    Miss. Jain
    Microsoft Certified Technology Specialist in .Net

  • #766215
    Hi

    What is your requirement?

    This is Webconfig Redirection
    ========================

    <forms loginUrl="~/Account/Login.aspx" timeout="2880" />


    Cs Code Redirection
    ===========================
    Response.Redirect("Page1.aspx");
    Server.Transfer("Page1.aspx");


    do one thing checking session after login take credential details to store session after validation redirect to
    other page.

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.


Sign In to post your comments