.net script inside <body> tag

telur13

Newcomer
Joined
Sep 7, 2007
Messages
2
Hi there, i'm kinda new to ASP.net

here the prob, i want to retrieve data from database but inside the table that i create. Normally <script> xtreme </script> i put it on the upper part, but now i want to split it up.

[highlight=asp]
<script language=c# runat=server debug=true>

void Page_Load (object sender, EventArgs e)
{
*//retrieve data but now the placing takes prob
*
Response.Write("haha"); -> is executed i saw the result
}

</script>

///////////////////////////
now inside the body..
//////////////////////////

<html>
*//i got table create here. i want to put the data that i retrieve inside here
*
<script> Response.Write("haha"); </script> -> got no result at all

*
</html>
[/highlight]
if i put <%Response.Write("haha");%> it works!!

guys any idea?
 
Last edited by a moderator:
My initial thought would be to avoid using Response.Write directly from the html markup ;)

Could you not use a literal control within the markup and assign a value to it from the Page_Load event instead?
 
Why not use <% %>?

if i put <%Response.Write("haha");%> it works!!

Why not just use the <% %> tags then? As far as I know they have the same effect.

Incidentally, your later <script> tags may not be working since you did not specify the runat and language attributes.
 
well what do you mean with literal control?

Table A
-----------
| | |
-----------
| X | |
-----------

here is my problem, suppose i want to show the data from database in X mark position. I create a table then the coding of retrieving data is on the upper part then the result, data will be shown above the table, i try to put the code (split it up) it on the X mark still can not work.

oh ya..
<% %> i use it for trapdoor only. ^^
<script> part actually has had complete attributes <- lol
 
Back
Top