링크 버튼이있는 격자보기가 있습니다. 클릭 할 때, 나는 어떤 작업을 수행하고 싶었고 클릭 된 링크 버튼을 보이지 않게해야합니다. 보이지 않게 만드는 방법?클릭하면 격자보기에서 링크 단추를 보이지 않게 만드는 방법?
내 코드 :
<asp:TemplateField ShowHeader="true" HeaderText="Theory">
<ItemTemplate>
<asp:LinkButton ID="lb_theory" runat="server" CausesValidation="false" CommandArgument='<%#Eval("student_id")%>' OnClientClick="this.disabled = true; " CommandName="theory_remove" Text="Remove"
command = "lnk_Click" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="true" HeaderText="Practical">
<ItemTemplate>
<asp:LinkButton ID="lb_practical" runat="server" CausesValidation="false"
CommandArgument='<%#Eval("student_id")%>' CommandName="practical_remove" Text="Remove"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
및
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "theory_remove")
{
string st_id = Convert.ToString(e.CommandArgument.ToString());
string t_id = (string)Session["test"];
SqlConnection con = obj.getcon();
con.Open();
string theory_state = "0";
SqlCommand cmd = new SqlCommand("update student_vs_testsession_details set theory='" + theory_state+ "' WHERE student_id='" + st_id + "' and testsession_id='" + t_id + "'", con);
int temp = cmd.ExecuteNonQuery();
}
}
당신이 내 코드를 보았는가이 방법을 시도? –