views:

117

answers:

2

When I drop an html image onto my page (vs2005) the height and width attributes are not specified.

Do I really have to edit the html by hand to add these? Or is there an automatic method?

A: 

You can template a section of code and add an item in the toolbox for it.

Type the code you want as your template in the editor, select it, then drag and drop to the toolbox. You can then drag and drop from the toolbox into any source code you want.

Edit: This works for any text in Visual Studio, not just HTML.

Jon Seigel
how would this automatically insert the image height and width in an HTML tag?
groves
If you include the height and width tags in the text you drop into the toolbox, it will be reproduced when you drag and drop from the toolbox onto your source code. There isn't any trick to it -- it just copy/pastes what you write. There's no mechanism that I know of to insert default attributes when dropping a control onto your code.
Jon Seigel
A: 

Just drag it into the design view. Simples.

Ben