This is a migrated thread and some comments may be shown as answers.

RadPanelBar postbacks

5 Answers 83 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Mac
Top achievements
Rank 2
Mac asked on 05 Aug 2009, 03:16 PM
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.

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 05 Aug 2009, 03:23 PM
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.
0
Mac
Top achievements
Rank 2
answered on 05 Aug 2009, 03:29 PM
Thanks Albert, is there a way to specify that the url should be an HttpPost
0
Atanas Korchev
Telerik team
answered on 05 Aug 2009, 04:18 PM
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.
0
Mac
Top achievements
Rank 2
answered on 05 Aug 2009, 04:23 PM

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.

0
Atanas Korchev
Telerik team
answered on 05 Aug 2009, 04:27 PM
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.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Mac
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Mac
Top achievements
Rank 2
Share this question
or