This is a discussion on Binding data to the RadioButtonList Control within the .Net Development forums, part of the Programming & Scripting category; Hi guys trying to bind data to my RadioButtonList control, but i'm getting this error: Code: Description: An error occurred ...
| |||||||
|
#1
| ||||
| ||||
| Hi guys trying to bind data to my RadioButtonList control, but i'm getting this error: Code: Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.ListItem does not have a DataBinding event.
Source Error:
Line 50: <td class="generalPadding" colspan="2">
Line 51: <asp:RadioButtonList ID="rblAddForms" runat="server">
Line 52: <asp:ListItem Text='<%#Eval("Name")%>' Value='<%#Eval("Idkey")%>' Enabled="true"></asp:ListItem>
Line 53: </asp:RadioButtonList>
Line 54: <asp:Repeater ID="rpAddForms" runat="server" OnItemDataBound="rpAddForms_OnItemDataBound">
Source File: /keithdesign/CustomControls/specinstructions_interior.ascx Line: 52
Code: <asp:RadioButtonList ID="rblAddForms" runat="server">
<asp:ListItem Text='<%#Eval("Name")%>' Value='<%#Eval("Idkey")%>'></asp:ListItem>
</asp:RadioButtonList>
Code: Public Sub Populate_rblAddForms()
Dim FormsList As New FormsList
myParams.OrderBy = "name ASC"
FormsList = FormsManager.GetList(myParams)
'bind data to rpAddForms repeater
rblAddForms.DataSource = FormsList
rblAddForms.DataBind()
End Sub
bind to the RadioButtonList? Shem |
|
#2
| ||||
| ||||
| Try this:- Code: <asp:RadioButtonList ID="rblAddForms" runat="server" appenddatabounditems="true" datatextfield="Name" datavaluefield="Idkey" textalign="Left" /> |
| The Following User Says Thank You to richyrich For This Useful Post: | ||
Shem (December 3rd, 2008) | ||
|
#3
| ||||
| ||||
| thanks RR ![]() Shem Last edited by Shem; December 3rd, 2008 at 02:54 AM. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Binding data... | Shem | .Net Development | 6 | July 7th, 2008 07:06 AM |
| The data source 'ObjectDataSource1' does not support sorting with IEnumerable data | Shem | .Net Development | 5 | June 25th, 2008 08:07 AM |
| WebCharts Control | richyrich | .Net Development | 1 | April 4th, 2008 11:14 AM |