62,240
社区成员




protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataRowView RowView = (DataRowView)e.Row.DataItem;
string bID = RowView["businessID"].ToString();
if (e.Row.RowState == DataControlRowState.Normal)
{
HyperLink BusinessLinkObject = (HyperLink)e.Row.FindControl("HyperLinkBusinessName");
if (e.Row.Cells[9].Text == "餐馆美食")
BusinessLinkObject.NavigateUrl = "restaurant.aspx?id=" + RowView["businessID"];
}
}
Convert.Tostring(Object)
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
string bID = "";
if (e.Row.RowState == DataControlRowState.Normal)
{DataRowView RowView = (DataRowView)e.Row.DataItem;
bID=RowView["businessID"].ToString();
HyperLink BusinessLinkObject = (HyperLink)e.Row.FindControl("HyperLinkBusinessName");
if (e.Row.Cells[9].Text == "餐馆美食")
BusinessLinkObject.NavigateUrl = "restaurant.aspx?id=" + bID; }
}
上面的错了 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataRowView RowView = (DataRowView)e.Row.DataItem;
string bID = "";
if (e.Row.RowState == DataControlRowState.Normal)
{
bID=RowView["businessID"].ToString();
HyperLink BusinessLinkObject = (HyperLink)e.Row.FindControl("HyperLinkBusinessName");
if (e.Row.Cells[9].Text == "餐馆美食")
BusinessLinkObject.NavigateUrl = "restaurant.aspx?id=" + bID; }
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView RowView = (DataRowView)e.Row.DataItem;
string bID = RowView["businessID"].ToString();
HyperLink BusinessLinkObject = (HyperLink)e.Row.FindControl("HyperLinkBusinessName");
if (e.Row.Cells[9].Text == "餐馆美食")
BusinessLinkObject.NavigateUrl = "restaurant.aspx?id=" + bID;
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowState == DataControlRowState.Normal)
{
DataRowView RowView = (DataRowView)e.Row.DataItem;
string bID = RowView["businessID"].ToString();
HyperLink BusinessLinkObject = (HyperLink)e.Row.FindControl("HyperLinkBusinessName");
if (e.Row.Cells[9].Text == "餐馆美食")
BusinessLinkObject.NavigateUrl = "restaurant.aspx?id=" + RowView["businessID"];
}
}