Repeater控件代码: <table width="800px" cellpadding="0" cellspacing="0" >
<tr style=" background-color:#A9A9A9; height:25px; color:White " align="center">
<td style=" width:50px; font-size:15px">类型ID</td>
<td style=" width:2px; background-color:White"></td>
<td style=" width:144px; font-size:15px">专题栏目类型名称</td>
<td style=" width:2px; background-color:White"></td>
<td style=" width:200px; font-size:15px">自媒体专题栏目名称</td>
<td style=" width:2px; background-color:White"></td>
<td colspan="5" style=" width:400px; font-size:15px" >基本功能操作</td>
</tr></table>
<asp:Repeater ID="dglist" runat="server">
<ItemTemplate>
<table width="800px" cellpadding="0" cellspacing="0" style="font-size:15px">
<tr style="background-color:#F8F8FF; height:25px" align="center" >
<td style=" width:50px">
<A2:A2Label ID="lblID" runat="server" Text="lblID" />
</td>
<td style=" width:2px; background-color:White"></td>
<td style=" width:144px" >
<A2:A2Label ID="lblClassTypeName" runat="server" Text="lblClassTypeName" />
</td>
<td style=" width:2px; background-color:White"></td>
<td style=" width:200px">
<A2:A2Label ID="lblClassName" runat="server" Text="lblClassName" />
</td>
<td style=" width:2px; background-color:White"></td>
<td align="center" style="width:45px">
<asp:HyperLink ID="hlkModify" runat="server" Text="修改"></asp:HyperLink>
</td>
<td style=" width:10px"></td>
<td style=" width:45px">
<asp:LinkButton ID="lbnDel" runat="server" Text="删除" ></asp:LinkButton>
</td>
<td style=" width:10px;"></td>
<td align="center" style=" width:145px">
<asp:DropDownList ID="dplModifyUp" runat="server" >
</asp:DropDownList>
<asp:Button ID="btModifyUp" runat="server" Text="修改" ></asp:Button>
</td>
<td align="center" style=" width:145px">
<asp:DropDownList ID="dplModifyDown" runat="server" >
</asp:DropDownList>
<asp:Button ID="btModifyDown" runat="server" Text="修改" ></asp:Button>
</td>
</tr>
<tr>
<td style="background-color:White; height:2px" colspan="20" ></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
服务器代码中如何获取DropDownList的所选值呢???
<tr style=" background-color:#A9A9A9; height:25px; color:White " align="center">
<td style=" width:50px; font-size:15px">类型ID</td>
<td style=" width:2px; background-color:White"></td>
<td style=" width:144px; font-size:15px">专题栏目类型名称</td>
<td style=" width:2px; background-color:White"></td>
<td style=" width:200px; font-size:15px">自媒体专题栏目名称</td>
<td style=" width:2px; background-color:White"></td>
<td colspan="5" style=" width:400px; font-size:15px" >基本功能操作</td>
</tr></table>
<asp:Repeater ID="dglist" runat="server">
<ItemTemplate>
<table width="800px" cellpadding="0" cellspacing="0" style="font-size:15px">
<tr style="background-color:#F8F8FF; height:25px" align="center" >
<td style=" width:50px">
<A2:A2Label ID="lblID" runat="server" Text="lblID" />
</td>
<td style=" width:2px; background-color:White"></td>
<td style=" width:144px" >
<A2:A2Label ID="lblClassTypeName" runat="server" Text="lblClassTypeName" />
</td>
<td style=" width:2px; background-color:White"></td>
<td style=" width:200px">
<A2:A2Label ID="lblClassName" runat="server" Text="lblClassName" />
</td>
<td style=" width:2px; background-color:White"></td>
<td align="center" style="width:45px">
<asp:HyperLink ID="hlkModify" runat="server" Text="修改"></asp:HyperLink>
</td>
<td style=" width:10px"></td>
<td style=" width:45px">
<asp:LinkButton ID="lbnDel" runat="server" Text="删除" ></asp:LinkButton>
</td>
<td style=" width:10px;"></td>
<td align="center" style=" width:145px">
<asp:DropDownList ID="dplModifyUp" runat="server" >
</asp:DropDownList>
<asp:Button ID="btModifyUp" runat="server" Text="修改" ></asp:Button>
</td>
<td align="center" style=" width:145px">
<asp:DropDownList ID="dplModifyDown" runat="server" >
</asp:DropDownList>
<asp:Button ID="btModifyDown" runat="server" Text="修改" ></asp:Button>
</td>
</tr>
<tr>
<td style="background-color:White; height:2px" colspan="20" ></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
服务器代码中如何获取DropDownList的所选值呢???
解决方案 »
- BOSS想用我们公司写的加密狗程序加密一个没有源码的运行程序、谁能给个思路
- listView 加载图片的问题?
- 在c#中DataRow row=new DataRow();为什么错了????
- [数据绑定]取消控件和数据源的绑定
- 急~~~在线等,不改自己的应用程序,怎么在系统启动时(未输入帐号密码登陆window2k时)让自己的应用程序也跟着启动?
- c# 判断读取字段是否为空,并且赋值
- 请教EventLog类为什么不能写,应该怎么设置才对
- 好奇怪的一个问题!大家快帮忙来看一看呀!
- Winform怎么实现搜索引擎一样的搜索方法
- 文件夹打包和解包问题?
- C# Tebcontrol 右键关闭 在线等!
- RichTextBox如何自动加粗部分字符?
我的博客 程序员日记 http://www.ideaext.com 欢迎交流
/// <summary>
/// 更新数据
/// </summary>
/// <param name="e"></param>
private void myUpdate(System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
int myIndex = e.Item.ItemIndex; String orderid = ((Label)e.Item.FindControl("orderid")).Text.Trim().ToString();
String paymethod = ""; DropDownList reason = (DropDownList)this.myGrid.Items[myIndex].FindControl("ddlmethod"); if (reason.SelectedIndex == 0)
{
this.Response.Write("<script>alert('Choose a payment first!');history.back();</script>");
this.Response.End();
}
else
{
paymethod = reason.Text; string sql = "";
////求取当前键值
//string myKeyid = this.myGrid.DataKeys[myIndex].ToString();
try
{
sql = "update orderhead set syspaymethod=" + "'" + paymethod + "'" + "," + "orderstatus='Paid',paydate=now() where orderid=" + "'" + orderid + "'";
if (!nd.updateOrderStatus(sql))
{
this.Response.Write("<script>alert('Update failed!');history.back();</script>");
}
}
catch
{
this.Response.Write("<script>alert('Sorrry System error!');history.back();</script>");
this.Response.End();
}
finally
{
//撤销编辑状态
this.myGrid.EditItemIndex = -1;
//重新绑定
this.myGridBind();
}
}
}
{
DropDownList myDrop = e.Item.FindControl("drpList") as DropDownList;
}
protected void myDrop_SelectedIndexChanged(object sender,EventArgs e)
{
Response.Write(((DropDownList)sender).SelectedIndex.ToString());
}