大概是这个样子的
上面一个DataList控件,下面一个FormView控件
DataList的RepeatDirection属性设置为Horizontal,显示为5列,1行
当点击DataList中某一列时下面的FormView控件则显示的内容好比 :select * from a where column = '点击DataList某一列的值'FormView显示的内容是动态变化的,现在我就不知道在(1)不用ajax技术的前提下动态变化FormView内容,(2)怎么获取点击DataList某一列的值各位,能帮忙么,最好贴出代码
问题解决立即结贴
上面一个DataList控件,下面一个FormView控件
DataList的RepeatDirection属性设置为Horizontal,显示为5列,1行
当点击DataList中某一列时下面的FormView控件则显示的内容好比 :select * from a where column = '点击DataList某一列的值'FormView显示的内容是动态变化的,现在我就不知道在(1)不用ajax技术的前提下动态变化FormView内容,(2)怎么获取点击DataList某一列的值各位,能帮忙么,最好贴出代码
问题解决立即结贴
==
局部刷新?不用ajax还是别想了怎么获取点击DataList某一列的值
==
<asp:DataList ID="DataList1" runat="server" OnItemCommand="DataList1_ItemCommand">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="select">选择</asp:LinkButton>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
</ItemTemplate>
</asp:DataList>protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "select")
{
Response.Write((e.Item.FindControl("Label1") as Label).Text);
}
}
这之前一直做winform开发
一楼的大侠,我现在只想通过点击Label ,来更改下面的内容,不要LinkButton
并且Label 的值是动态加载的