Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Developing with Sitefinity > Response.Redirect Problem

Response.Redirect Problem

  • vijay avatar

    Posted on May 22, 2008 (permalink)

    Hi

    I am facing a problem of using Response.Redirect in sitefinity. I want to redirect form one page to another on button click But It is not working..

    protected void Button2_Click(object sender, EventArgs e)

    {

    Response.Write("test1.aspx");

    }

    Please help me

    Send email : vijay.sharma@softobiz.com .

    Regards

    Vijay Sharma

    Reply

  • Pepi Pepi admin's avatar

    Posted on May 22, 2008 (permalink)

    Hi vijay,

    Unfortunately, we cannot reproduce any problems with Response.Redirect method in Sitefinity. So, please check the following:
    1. If the URL for the target location is correct.
    2. If the button is registered for the event handler.

    Here is an example if the target page is in the main root of the Sitemap:

    .ascx
    <asp:Button ID="Button1" runat="server" Text="Click me!" OnClick="Button1_Click" /> 

    .ascx.cs
    protected void Button1_Click(object sender, EventArgs e) 
        { 
            Response.Redirect("~/test1.aspx"); 
        } 

    If this does not help, provide us with more detailed information for the steps to reproduce this issue. It will be very helpful if you send us the control that implements redirecting functionality to debug it locally.

    Do let us know how it goes.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Jeremy Summers avatar

    Posted on Mar 12, 2010 (permalink)

    I realize this is really old but if the author was trying to use the code listed, the code is using I realize this is really old but if the author was trying to use the code listed, the code is using Response.Write rather than Response.Redirect.

    J

    Reply

  • Posted on Nov 11, 2011 (permalink)

    Also, I just discovered that if you are doing this in VB.NET the button does not need to have OnClick in order to work.
    I used VB for the original MasterPage on my site, but now that is moving into Sitefinity, I decided to stick to C#.... could not figure out why my button was not working!

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Developing with Sitefinity > Response.Redirect Problem