更多按钮 原本是用的<asp:HyperLink>但是报错 ‘无法使用前导 .. 在顶级目录上退出’ 换成了<asp:ImageButton> 没有这种问题了
<asp:ImageButton ID="HLinkTopic" runat="server" CommandName="linkbtn" CommandArgument='<%# Bind("ProductID")%>' Visible="False" ImageUrl="images/MoveLast.gif" />
注意 CommandArgument='<%# Bind("ProductID")%>' 一定要是' '不能是 " "
后台
protected void dlst_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "linkbtn")
{
int Pid;
Pid = Convert.ToInt32(e.CommandArgument.ToString());
this.Response.Redirect(Globals.NavigateURL(this.PortalSettings.ActiveTab.TabID, "QAList", new string[] { "mid=" + base.ModuleId.ToString(), "ProductID=" + Pid }));
}
}
<asp:ImageButton ID="HLinkTopic" runat="server" CommandName="linkbtn" CommandArgument='<%# Bind("ProductID")%>' Visible="False" ImageUrl="images/MoveLast.gif" />
注意 CommandArgument='<%# Bind("ProductID")%>' 一定要是' '不能是 " "
后台
protected void dlst_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "linkbtn")
{
int Pid;
Pid = Convert.ToInt32(e.CommandArgument.ToString());
this.Response.Redirect(Globals.NavigateURL(this.PortalSettings.ActiveTab.TabID, "QAList", new string[] { "mid=" + base.ModuleId.ToString(), "ProductID=" + Pid }));
}
}