Making a Textbox "readonly" usind textbox.Attributes("")

D

Daren Hawes

Hi

I need to add an attribute to a Textbox to make it read only.

To add a CSS I use

DeptDate.Attributes("Class") = "textInput"

That adds 'Class="textinput"', but the readonly is like..

<Input readonly Class="xxx" ...

How can I programatically ad the readonly bit if it doeas not have a
name like "Class" doeas?

Thx Daren
 
J

Jeff Johnson

<Input readonly Class="xxx" ...

How can I programatically ad the readonly bit if it doeas not have a
name like "Class" doeas?

readonly="readonly"

Looks silly but that's how you handle the "parameter-less" attributes
nowadays.
 
C

Cor Ligthert

Hi Daren,

Assuming you are using a webform, why not just a label with a nice border.

Cor
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top