[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4612
  • Last Modified:

response write into div

Hi experts

I have a webpage where i do this:

<body style="background-color: #D2DADC" onload="runscripts()">
    <form id="form1" runat="server">
    <!-- #Include File="topdesign.aspx" -->
    <div class="divtekstbody" id="mainarea">
    <!-- #Include File="bunddesign.aspx" -->

the include files contains my general design, and it works like a charm. But on the server side i try to do this:
Response.Write("<a href='pictures.aspx?lag=" + strfolderlink + "'>" + arrfolders[u].ToString() + " / " + "</a>");
and that works as well, but, but the response write function are placing my code before <!-- #Include File="topdesign.aspx" --> and i want the code between my include file topdesign and bunddesign. Then i was thinking if you could make the response write to place the code inside a DIV?

Can some one help me with a solution?
  • 3
1 Solution
Hi, you can create a custom control place it in there wherever you want,  handle its render event, use the html writer object to write first the <div> tag and then write your stuff in it again using the writer object and close the div tag again by letting writer write '</div>' at the end.

DCRAPACCESSAuthor Commented:
Sorry i don't really understand your answer, can you write an example?
DCRAPACCESSAuthor Commented:
Stupid me, I just need to add runat="server" to my div :-)
DCRAPACCESSAuthor Commented:
sorry for the trouble!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now