views:

160

answers:

2

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

+1  A: 

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
Kangkan
Thanks mate!!It worked..
Parth
@Parth, if it worked why not accept the answer?
Pharabus
@kangkan sorry mate forgot it,, had to implement that first
Parth
A: 

Or like this...

    LinkButton1.Visible = "true"
Germ