我有一個Gridview和rowDatabound我創建點擊該行和 顯示模式彈出。我想要的是當點擊行時,該行的ID應該被傳遞。如何從客戶端腳本訪問參數
protected void grdOrderProduct_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#ceedfc'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=''");
e.Row.Attributes.Add("style", "cursor:pointer;");
e.Row.Attributes["onClick"] = Page.ClientScript.GetPostBackClientHyperlink(btnPop, "12");
}
}
如何在服務器控件上獲取此「12」。我已經把12作爲靜態演示。但它會改變。
如何從功能訪問這個值? – Moiz
我明白了你的觀點。但我想知道我是否需要創建此類?並在哪裏創建? – Moiz
如果你想接收自定義事件,那麼你需要創建這個類。您可以在解決方案中的任何位置的標準cs文件中創建此文件。像這些控件被稱爲自定義控件或服務器控件。 – nunespascal