Как сделать girdview номера редактируемой или изображение кнопки, не редактируемые в ASP .СЕТКА С#
I need to make the gridview not editable if uploaded date is not equal to todays date that means my gridview should be editable only for that particular day for this i have done in below way but after displaying the message i should make my image edit non clickable but i am unable to do that.How can i solve this protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e) { BindData(); string date=DateTime.Now.ToString(); string uploadeddate = Session["UploadedDate"].ToString(); if (uploadeddate == date) { BtnExport.Visible = true; GridView2.EditIndex = e.NewEditIndex; BindData(); } else { lblMsg.Visible = true; lblMsg.Text = "You Can Edit The Data Only On Uploaded Day!!!"; } } <asp:TemplateField HeaderText="Action"> <ItemTemplate> <asp:ImageButton ID="imgbtnEdit" runat="server" CommandName="Edit" ImageUrl="Images/icon-edit.png" Height="32px" Width="32px"/> </ItemTemplate> <EditItemTemplate> <asp:ImageButton ID="imgbtnUpdate" runat="server" CommandName="Update" ImageUrl="Images/update1.jpg"/> <asp:ImageButton ID="imgbtnCancel" runat="server" CommandName="Cancel" ImageUrl="Images/cancel.jpg"/> </EditItemTemplate> </asp:TemplateField>
Что я уже пробовал:
я пытаюсь вызвать идентификатор кнопки изображения
<asp:ImageButton ID="imgbtnEdit" runat="server" CommandName="Edit" ImageUrl="Images/icon-edit.png" Height="32px" Width="32px"/>
imgbtnEdit. enabled=false; в c#, но он не работает