Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Displaying Response.Output.Write in a certain location on a web form

  • 24-07-2007 04:16PM
    #1
    Registered Users, Registered Users 2 Posts: 546 ✭✭✭


    Hi,

    Using Asp .net 2.0 and C#

    I have some javascript that builds up a tree of data that gets displayed on my webform using Response.Output.Write
    Code works fine but I'm trying to move the results below the other controls in my webform. Response.Output.Write obviously prints it at the top
    Response.Output.Write("<ul class=\"tree\">\n");
    .....<work>.......
    Response.Output.Write("</ul>\n");
    

    I can move my results around the page using div. However this is not ideal as I won't be certain it will always display below my controls
    Response.Output.Write("<div style='position: absolute; top: 390; left: 30'><ul class=\"tree\">\n");
    .....<work>.......
    Response.Output.Write("</ul></div>\n");
    
    

    I've tried to add the results to a label but can't get it to work.
    Any ideas if this is possible since i'm using Response.Output.Write instead of a string


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Could you build the tree up as a string then set a page elements InnerHTML to equal the string?


  • Registered Users, Registered Users 2 Posts: 15,079 ✭✭✭✭Malice


    What were the issues you encountered when trying to use a label? That was the first thing I thought of when I saw the thread title.:)
    I find when using labels that I sometimes have to have them inside <div> tags e.g.

    [PHP]<div id="footer">
    <asp:Label id="footerText" runat="server"></asp:Label>
    </div>[/PHP]
    I normally just use a StringBuilder object to build up the HTML output and then set the text of the label.


Advertisement