110,535
社区成员
发帖
与我相关
我的任务
分享
<asp:TemplateField HeaderText="Regulation Name">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" Target="_self"
NavigateUrl='<%# Fromat(Eval("id")) %>'
Text='<%# Eval("Name") %>'></asp:HyperLink>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
.cs: public string Fromat(object id)
{
return string.Format("javascript:var win=window.open('Regulation_Item.aspx?ID={0}',null,'width=600,height=500')", id);
}
链接页面.cs传值:string id = Request.QueryString["id"];
string selectcontent = "select * from 表ion where id='" + id + "'";
DataBase db = new DataBase();
DataSet ds = db.GetDataSetSql(selectcontent);
DataTable dt = ds.Tables[0];
TB_Name.Text = dt.Rows[0]["Name"].ToString();
<asp:HyperLink ID="hl_code" runat="server" Text='<%# Eval("_id") %>' NavigateUrl='<%# "http://www.baidu.com"+Eval("_id") %>'
Target="_blank"></asp:HyperLink>