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

发布于 2024-09-01 17:41:07 字数 447 浏览 6 评论 0原文

如何在asp.net(vb)中的button_click()中单击另一个按钮后使链接按钮可见,

它显示错误为“对象引用未设置到对象的实例”。

我在我的代码中完成了此操作

Protected 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

How to make a link button visible after another button has been clicked in asp.net(vb) in button_click()

it says error as "Object reference not set to an instance of an object."

i've done this in my code

Protected 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

水染的天色ゝ 2024-09-08 17:41:07

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

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

Remove the form name like this:

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
淡墨 2024-09-08 17:41:07

或者像这样...

    LinkButton1.Visible = "true"

Or like this...

    LinkButton1.Visible = "true"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文