vs 2008 events missing

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I just started using VS 2008 and found that some of the controls events are
gone.

I was using some controls from my 2003 page and got errors on:

button.enabled
button.Text

Both say they are not members of controls.

Why is that?

Thanks,

Tom
 
Munna said:
Hi

"found that some of the controls events are
gone. "

you are talking about property right?

some events on the data controls are changed
like

itemdatabound changed to rowdatabound in case of datagrid

but primitive stuff is not changed..

please check the converted project's namespaces again.

I was playing with it and figured out what it was. In the following:

addQuestionButton.enabled = True

I was setting a button variable to passed object:

Dim addQuestionButton = e.Item.FindControl("AddQuestion")

But this wasn't setting it to a button, I guess, until I changed it to:

Dim addQuestionButton = CType(e.Item.FindControl("AddQuestion"),
Button)

And then it worked fine.

I am kind of surprised that I didn't need an "As Button" in it like so:

Dim addQuestionButton As Button =
CType(e.Item.FindControl("AddQuestion"), Button)

Thanks,

Tom
 
Back
Top