<asp:ButtonField ButtonType="Image" CausesValidation="True" DataTextField="path"
ImageUrl="~/Images/pc_play.gif" Text="试听" CommandName="select"
/>
这里面的值还不就是你的数据库里面的”path“那一列啊?
ImageUrl="~/Images/pc_play.gif" Text="试听" CommandName="select"
/>
这里面的值还不就是你的数据库里面的”path“那一列啊?
public void GridViewGuttonField(Object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "select")
{
string controlName = "Player.ascx";
UserControl control = (UserControl)LoadControl("ascx/" + controlName);
PlaceHolder1.Controls.Add(control);
}
}
已经把Player.ascx加载进来了.就是取不到pathr的值..
<asp:ButtonField ButtonType="Image" CausesValidation="True" DataTextField="path"
ImageUrl="~/Images/pc_play.gif" Text="试听" CommandName="select"/>
UserControl 改为ImageButton或button