I can't seem to get postbacks working.
I've tried both BeginForm and BeginFormRoute methods around the RadPanelBar.
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.
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
0
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.
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
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.
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
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.
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.