嗨,我收到以上錯誤。請在我的代碼見下文&暗示我什麼,我做錯了什麼:無法獲得div_images的內容,因爲內容不是字面的
HTML:
string ProductImages = string.Empty;
string str_query = string.Empty;
DataTable dt_Common = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind_images();
}
}
代碼:
private void bind_images()
{
if (Request.QueryString["id"] != null)
{
str_query = "select top(5) image from tbl_product_images where productinfo_id='" + Request.QueryString["id"].ToString() + "'";
dt_Common = new CommonClass().bind_department(str_query);
if (dt_Common.Rows.Count> 0)
{
for (int i = 0; i < dt_Common.Rows.Count; i++)
{
div_images.InnerHtml += "<a class=\"activeborder\" data-image=" + dt_Common.Rows[i]["image"] + " data-zoom-image=" + dt_Common.Rows[i]["image"] + "><img src=" + dt_Common.Rows[i]["image"] + " /></a>"; // Getting error in this line.
}
}
}
else
{
}
}
我從過去的日子嘗試過,但沒有得到解決方案。任何建議真的很感激。
您是否嘗試過'.InnerText'財產? – vijay 2013-05-13 12:54:51