By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,627 Members | 2,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,627 IT Pros & Developers. It's quick & easy.

DataBinding and RadioButtonList

P: n/a
I`m killing my computer for 2 days and I can`y figure it out. First I
will present the situation:
I`m building and WWW system in VS 2005. I`m using a MaterPage ( maybe
this is the problem ) and in one web form I put the ForView with edit
state enabled. In this edit temlate I`ve got RadioButtonList with two
items: Yes (value: true), No (value: false).
When I do the INSERT I want to read the value of selected item from
RadioButtonList. But anytime I do it, I always get false (when I tried
with string format it was always returning null).
When I did the same temlate without MasterPage ( without ContentPage )
it worked.
What in the hell is the problem??
Please HELP...
---------------- HTML CODE --------------------

<table class="formtable" cellspacing='0'
border='1' style="width: 579px">
<td style="width: 90px; height: 2px"
align="center" >
<asp:Label ID="LabelBasic"
runat="server" Text="Basic Info"></asp:Label></h4>
<td class="label" style="width: 90px;
height: 29px">
<asp:Label ID="LabelName"
runat="server" Text="Name:" ></asp:Label></td>
<td style="width: 178px; height:
29px; font-size: 7pt;" >
<asp:TextBox ID="TextBoxName"
runat="server" CssClass="inputtext" Width="261px" Text='<%#
Bind("Name") %>'></asp:TextBox>
ID="RequiredFieldValidatorName" runat="server" ErrorMessage="Name is
<td class="label" style="width: 90px;
height: 29px">
<asp:Label ID="LabelCompanyName"
runat="server" Text="Assigned Comapny:" Width="112px"></asp:Label></td>
<td style="font-size: 7pt; width:
178px; height: 29px">
ID="CheckBoxCompany" runat="server" Text="Yes" Checked="false" />
<td id="companyList"
runat="server" style="width: 220px" visible="true">
ID="DropDownListCompanyName" runat="server" Width="153px"
DataSourceID="ObjectDataCompany" DataTextField="Name"
DataValueField="IdCompany" SelectedValue='<%# Bind("IdCompany") %>'
DataSource='<%# Bind("Name") %>'>

</asp:DropDownList><asp:ObjectDataSource ID="ObjectDataCompany"
runat="server" SelectMethod="SelectCompanyIdName"

<tr id="companyAdmin" runat="server">
<td class="label c4" style="width:
90px; height: 25px;">
<asp:Label ID="LabelCompanyAdmin"
runat="server" Text="Company Admin:" Width="103px"></asp:Label></td>
<td class="c4" style="font-size: 7pt;
color: #666666; width: 178px; height: 25px;">
ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"
SelectedValue='<%# Bind ("CompanyAdmin") %>'>
<td class="label c4" style="width:
<asp:Label ID="LabelComments"
runat="server" Text="Comments:" Width="103px"></asp:Label></td>
<td class="c4" style="font-size: 7pt;
width: 178px; color: #666666">
<asp:TextBox ID="TextBoxComments"
runat="server" CssClass="inputtext" TextMode="MultiLine" Width="146px"
Text='<%# Bind("Comments") %>'></asp:TextBox></td>
<br />
<br />
&nbsp;<asp:Button ID="ButtonCreate"
runat="server" CommandName="Insert" Text="Create"
CssClass="inputsubmit" Height="19px" Width="61px" />&nbsp;

Jul 26 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.