我有一个带有 2 个链接按钮的 gridview:选择和编辑和 1 个复选框我需要在页面加载时禁用链接按钮和复选框
这是我的asp页面:
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox id="Select" runat="server" OnCheckedChanged="CheckedChanged" AutoPostBack="false"/>
<asp:LinkButton ID="idedit" CommandName="Edit" CausesValidation="true" runat="server"
ToolTip="Edit" Text="Edit"/>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="idupdate" CommandName="Update" runat="server" CausesValidation="false" Text="Update"
ToolTip="Update" OnClientClick="javascript:if(!confirm('Are you sure do you want to update this?')){return false;}" />
<asp:LinkButton ID="idcancel" runat="server" CommandName="Cancel" CausesValidation="false"
Text="Cancel" ToolTip="Cancel"/>
</EditItemTemplate>
</asp:TemplateField>
这是我的VB代码:
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Session("priv") = "host" Then
fname_txt.Visible = False
lname_txt.Visible = False
email_txt.Visible = False
birthday_txt.Visible = False
phone_txt.Visible = False
adresss_txt.Visible = False
Label2.Visible = False
Label3.Visible = False
Label4.Visible = False
Label5.Visible = False
Label6.Visible = False
Label7.Visible = False
btn_delete.Visible = False
btn_new.Visible = False
Btn_save.Visible = False
End If
If Not IsPostBack Then
GridView1.DataSource = x.selectProfile()
GridView1.DataBind()
End If
End Sub
先感谢您 :)