response write into div

Posted on 2008-11-19
Last Modified: 2012-05-05
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?
    LVL 12

    Expert Comment

    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.


    Author Comment

    Sorry i don't really understand your answer, can you write an example?

    Accepted Solution

    Stupid me, I just need to add runat="server" to my div :-)

    Author Comment

    sorry for the trouble!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now