RadPanelBar postbacks

Thread is closed for posting
6 posts, 0 answers
  1. Mac
    Mac avatar
    36 posts
    Member since:
    Nov 2006

    Posted 05 Aug 2009 Link to this post

    I can't seem to get postbacks working.

    I've tried both BeginForm and BeginFormRoute methods around the RadPanelBar.

    <% using (Html.BeginRouteForm("AddFilter", FormMethod.Post)) { %> 
            <telerik:RadPanelBar ID="filterAttributes" runat="server" Width="200px" /> 
    <% } %> 

    I've also tried the postbackurl attribute but to no avail. Is there an example anywhere of the RanPanelBarItem posting back to a controller action?

    Cheers
    Mac.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 05 Aug 2009 Link to this post

    Hello Mac,

    I guess you are trying to use RadPanelbar as a button to submit a form. I am afraid this cannot be done as RadPanelBar renders <A> elements which navigate instead of post. If you want to navigate to a controller method you can use this approach:

    <%
    panelbar.DataBind();
    %>
    <telerik:RadPanelBar ID="panelbar">
          <Items>
                 <telerik:RadPanelItem Text="Home" NavigateUrl="<%# Url.Action("Index", "Home") %>" />
           </Items>
    </telerik:RadPanelBar>

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mac
    Mac avatar
    36 posts
    Member since:
    Nov 2006

    Posted 05 Aug 2009 Link to this post

    Thanks Albert, is there a way to specify that the url should be an HttpPost
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 05 Aug 2009 Link to this post

    Hello Mac,

    No, this is not possible. RadPanelBar renders hyperlinks which do HTTP GET.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Mac
    Mac avatar
    36 posts
    Member since:
    Nov 2006

    Posted 05 Aug 2009 Link to this post

    Not even something like this?

    <a href=”javascript: myclientsideUrlPostMethod()”

    or <a href="#" onclick="myclientsideUrlPostMethod()"

    Given that I want to use certain PanelBarItems to submit data but I cannot have that data send over in a url for security reasons this seems like it pretty much kills the radpanelbar use in MVC for me. shame really

    Thanks
    Mac.

  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 05 Aug 2009 Link to this post

    Hello Mac,

    You can try this then:

    <telerik:RadPanelBar ID="panelbar">
          <Items>
                 <telerik:RadPanelItem Text="Home" NavigateUrl="javasript:something();" />
           </Items>
    </telerik:RadPanelBar>

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017