如何在button_click()中的asp.net(vb)中单击另一个按钮后显示链接按钮

时间:2010-05-14 15:23:38

标签: asp.net vb.net linkbutton

如何在按钮_click()

中的asp.net(vb)中单击另一个按钮后显示链接按钮

它将错误称为“对象引用未设置为对象的实例。”

我在我的代码中完成了这个

受保护的Sub InsertButton_Click(ByVal sender As Object,ByVal e As System.EventArgs)

    Dim receipt As LinkButton = FormView1.FindControl("LinkButton1")

   ' receipt.Enabled = "true"
   ' receipt.EnableTheming = "true"
   ' receipt.EnableViewState = "true"
    receipt.Visible = "true"

End Sub

2 个答案:

答案 0 :(得分:1)

删除表单名称,如下所示:

Dim receipt As LinkButton = FindControl("LinkButton1")
If (Not receipt Is Nothing)
   ' receipt.Enabled = "true"
   ' receipt.EnableTheming = "true"
   ' receipt.EnableViewState = "true"
    receipt.Visible = "true"
End if

答案 1 :(得分:0)

或者像这样...

    LinkButton1.Visible = "true"