PDA

View Full Version : HTMLControls in CodeBehind


deidei76
02-21-2005, 07:35 AM
Hi!

I'm having problems with my Input button.

It is declared as an HTMLControl

<INPUT type="button" value="End Call" Class="imgbutton" Name="btnEndCall">

In my CodeBehind page, i declared it as:

protected System.Web.UI.HtmlControls.HtmlInputButton btnEndCall;

The problem is that when I try to access it like this....

this.btnEndCall.Disabled = true;

I get a message:

"Object reference not set to an instance of an object."

Hope somebody can help me. thanks in advance.!=)

graimg
02-23-2005, 01:00 AM
Add runat="server" with html.

<INPUT id="btnEndCall" type="button" value="Button" runat="server">

-graim

deidei76
02-25-2005, 05:08 AM
thanks=).............