首页 新闻 会员 周边 捐助

将DataList选中的值显示在RadioButtonList,然后进行更新的时候如何取值了更改

0
悬赏园豆:10 [已关闭问题]
1

 

代码


将DataList中选中的值显示在RadioButtonList,然后RadioButtonList有A,B,C,D,E,F一组值,如果DataList
选中的值是A,然后在RadioButtonList中选择B,然后
点击更新,数据库的值发生改变
<div style="border:2px; width:250px;height:250px;font:left">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width: 100px; height: 19px;" align="center">
类型:
</td>
<td style="width: 100px; height: 19px;" align="center">
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList></td>
</tr>
<tr>
<td align="center" colspan="2">
选择房间状态
</td>
</tr>
<tr>
<td align="center" colspan="2">
</td>
</tr>
<tr>
<td style="width: 100px; height: 19px;" align="center">
<asp:RadioButtonList id="rblRoomState" runat="server" Height="164%" Width="66px"><asp:ListItem Value="empty">空闲</asp:ListItem>
<asp:ListItem Value="housing">住房</asp:ListItem>
<asp:ListItem Value="helpOneself">自用</asp:ListItem>
<asp:ListItem Value="modify">维修</asp:ListItem>
<asp:ListItem Value="arrive">将到</asp:ListItem>
<asp:ListItem Value="leave">将离</asp:ListItem>
</asp:RadioButtonList>
</td>
<td style="width: 100px; height: 19px;" align="center"> <div style="float:right; position:relative; width:50%;border-spacing:0px; text-align:center; padding-top:8px;">
<div style="height:43px;"><asp:Image ID="imgEmpty" runat="server" ImageUrl="RoomState/empty.jpg" /></div>
<div style="height:45px; padding-top:3px;"><asp:Image ID="imgHousing" runat="server" ImageUrl="RoomState/housing.jpg" /></div>
<div style="height:45px; padding-top:3px;"><asp:Image ID="imgHelpOneself" runat="server" ImageUrl="RoomState/helpOneself.jpg" /></div>
<div style="height:45px; padding-top:3px;"><asp:Image ID="imgModify" runat="server" ImageUrl="RoomState/modify.jpg" /></div>
<div style="height:45px; padding-top:3px;"><asp:Image ID="imgArrive" runat="server" ImageUrl="RoomState/arrive.jpg" /></div>
<div style="height:45px; padding-top:3px;"><asp:Image ID="imgLeave" runat="server" ImageUrl="RoomState/leave.jpg" /></div>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="height: 15px">
</td>
</tr>
<tr>
<td align="center" colspan="2" style="height: 19px">
<asp:Button ID="Button1" runat="server" Text="更新" /></td>
</tr>
</table>
</div>
<div style="border:2px;width:400px;height:400px;float:right;margin-top:10px; z-index: 100; left: 264px; position: absolute; top: 89px;">


<asp:DataList ID="DataList1" runat="server" RepeatColumns="8" RepeatDirection="Horizontal" OnItemCommand="DataList1_ItemCommand1" >
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width: 100px; height: 19px;">
<asp:ImageButton ID="ibtnCheck" runat="server" ImageUrl='<%# GetStateImage( Eval("State") ) %>' CommandArgument='<%#Eval("RoomId") %>' CommandName="my" />
</td>
</tr>
<tr>
<td style="width: 100px; height: 19px;">
<asp:Label ID="Label1" runat="server" Text='<%#Eval("number") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</div>


//更新
protected void Button1_Click(object sender, EventArgs e)
{
????如何取值了填写Sql语句啊
}

 

悟.空的主页 悟.空 | 初学一级 | 园豆:4
提问于:2010-03-22 00:36
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册