1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Changing Postback URL of button in UserControl

Changing Postback URL of button in UserControl

2 posts, 0 answered
  1. Benjamin
    Benjamin avatar
    12 posts
    Registered:
    29 Apr 2008
    08 Nov 2009
    Link to this post
    Hello,

    I was wondering if anyone knows how to change the postback url of a button in a custom user control. I am aware that Sitefinity disables the PostBackUrl of buttons. However, has anyone found a workaround other than 'RedirectUrl'.

    I have found this thread that seemed to work if the button was used in a masterpage. But, when I apply similar logic to a usercontrol it does not seem to be working for me.

    Forum Post:
    http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/template-master-breaks-cms.aspx

    Code I have tried:

    protected void Page_Load(object sender, EventArgs e) 
        { 
            CmsPageBase cmsPage = this.Page as CmsPageBase; 
            if (cmsPage.PageMode == CmsPageMode.Live) 
            { 
                btnSubmit.PostBackUrl = "http://posthere.com"
            } 
        } 

    Thanks,
    Ben
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    08 Nov 2009
    Link to this post
    Hi Benjamin,

    You can try using Server.Transfer or getting a query string from the url and setting the PostBackUrl.



    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered