Setting textbox width from server side

Discussion in 'ASP .Net' started by Harry, Jun 26, 2003.

  1. Harry

    Harry Guest

    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
    Harry, Jun 26, 2003
    #1
    1. Advertising

  2. Harry

    Onur Bozkurt Guest

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


    "Harry" <> wrote in message
    news:#MDPVe$...
    > 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
    >
    >
    >
    >
    Onur Bozkurt, Jun 26, 2003
    #2
    1. Advertising

  3. Harry

    Harry Guest

    Thanks!

    "Onur Bozkurt" <> wrote in message
    news:uXiJaj$...
    > dim tb as new Textbox()
    > tb.width = system.web.ui.webcontrols.unit.pixel(80)
    >
    >
    > "Harry" <> wrote in message
    > news:#MDPVe$...
    > > 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
    > >
    > >
    > >
    > >

    >
    >
    Harry, Jun 26, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AndrewF
    Replies:
    1
    Views:
    733
    Bruce Barker
    Oct 10, 2005
  2. ppcguy
    Replies:
    3
    Views:
    1,229
    Toby Inkster
    Aug 26, 2005
  3. =?Utf-8?B?Vk1J?=

    Setting server-side textbox with javascript?

    =?Utf-8?B?Vk1J?=, Oct 9, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    785
    Mark Fitzpatrick
    Oct 9, 2006
  4. Replies:
    0
    Views:
    481
  5. Jeff
    Replies:
    1
    Views:
    393
    Nathan Sokalski
    Oct 8, 2008
Loading...

Share This Page