views:

1412

answers:

3

i am trying to postion the output to my aspx page by using response.write for that i am using this code:

Response.Write("&lt;<span id='Label1'' style='height:16px;width:120px;Z-INDEX: 102; LEFT: 288px; POSITION: absolute; TOP: 144px'>Its not at the top left corner!</span>");

this prints my message in the middle of the screen but also shows a "<" at the left corner. I have tried a few things but i am unable to get rid of it.

please help

any other way of positioning the output?

+1  A: 

Try:

Response.Write("<span id='Label1' style='height:16px;width:120px;Z-INDEX: 102; LEFT: 288px; POSITION: absolute; TOP: 144px'>Its not at the top left corner!</span>");

You had a &lt; at the beginning, which is giving you the "<" , and a double '' after Label1

But there are LOTS of better ways of positioning with CSS and producing output with Response.Write directly is generally not needed... What are you trying to do?

feihtthief
this works, thanks, i am showing the search results using response.write, any other sugguestion is welcome.
Sneha
+1  A: 

This or this or something like it will help you.

JP Alioto
A: 

man, i sometimes use response.write to make some quick output of HTML, but i really advise not to use it on big scale as there are much nicer and better ways to create clean HTMl output

  • there is a very nice feature called ParseControl(), which takes a string and convert it to control, like the one you did above.
  • use HTMLWriter.
  • use HTMLGeneric Control.

with all previous mentioned methods you can have nice control on a custom output you like.

Good luck.