Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

response.Write 1

Status
Not open for further replies.

Zarcom

Programmer
May 7, 2002
1,275
CA
Using code behind page and a response.write writes the text within the response.write at the very top of the html page. That is it is above the <html> tag.
Is it possible to bring this down so that it resides within the <body> tag?
 
What is it you're trying to do Zarcom? I'm just wondering if there isn't a better way to get text to magically appear where you want it without using response.write

(i.e. using a label, or a validation control, depending on what the situation is)

Jack
 
There is a couple places I use it.

1. as validation messages
ie.
Please fill in required field.
Please fill in other required field.

In this way I can put as many or few messages one under the other. The thing is in some browsers if the text is written above the <html> tag including everything else the style sheets written for the page don't work.

2. a dynamic list of links taken from a database
ie
link1
link2
etc

Do you know of another method to accomplish this?

Thanks for the help
 
Hey Zarcom,

There is actually a validator summary control that will display any validation messages in teh same way you want it to look, but you can put it wherever on the page.

For the buttons, you could create a panel on your page, and dynamically fill it with the links. That way, you specify where the panel is, and you dont have to worry about it overwriting other controls.

Jack
 
Thanks Jack!
One thing that I did notice is that the validator's don't seem to work on Netscape at all. Do you know of any fix for this?
 
Really? Hmmm...thats weird, since all the validators do is write javascript back to the browser, and I'm sure Netscape should support javascript.

Our clients only use IE, so we've never had to test with Netscape, so I really don't have an answer for you.

One thing you could try is just seeing what the javascript that is written by the controls looks like, and just copy that directly into the html view of your page (assuming that the version of javasript asp.net creates is compatible).

If I find anything else on this, I'll let you know.

Jack

ps: thanks for the star! Glad I could help. :)
 
np I was ecstatic when I got a star
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top