Saturday, March 24, 2012

Setting textbox width from server side

Hi

I'm trying to set the width of a textbox from the server side. I've tried

dim tb as new Textbox()
tb.width = "80"

but this gives me an error saying that the
"value of string cannot be converted to 'System.Web.UI.WebControls.Unit'"

How would I set the width? I've also tried

tb.width.pixels(80) and that does not seem to change the width.

Thanks
Harrydim tb as new Textbox()
tb.width = system.web.ui.webcontrols.unit.pixel(80)

"Harry" <NoSpam_shao_lin_monk@.yahoo.com> wrote in message
news:#MDPVe$ODHA.1624@.tk2msftngp13.phx.gbl...
> Hi
> I'm trying to set the width of a textbox from the server side. I've tried
> dim tb as new Textbox()
> tb.width = "80"
> but this gives me an error saying that the
> "value of string cannot be converted to 'System.Web.UI.WebControls.Unit'"
> How would I set the width? I've also tried
> tb.width.pixels(80) and that does not seem to change the width.
> Thanks
> Harry
>
Thanks!

"Onur Bozkurt" <onur.bozkurt@.softhome.net> wrote in message
news:uXiJaj$ODHA.1552@.TK2MSFTNGP10.phx.gbl...
> dim tb as new Textbox()
> tb.width = system.web.ui.webcontrols.unit.pixel(80)
>
> "Harry" <NoSpam_shao_lin_monk@.yahoo.com> wrote in message
> news:#MDPVe$ODHA.1624@.tk2msftngp13.phx.gbl...
> > Hi
> > I'm trying to set the width of a textbox from the server side. I've
tried
> > dim tb as new Textbox()
> > tb.width = "80"
> > but this gives me an error saying that the
> > "value of string cannot be converted to
'System.Web.UI.WebControls.Unit'"
> > How would I set the width? I've also tried
> > tb.width.pixels(80) and that does not seem to change the width.
> > Thanks
> > Harry

0 comments:

Post a Comment