Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

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

Options
  • 24-07-2007 4:16pm
    #1
    Registered Users 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 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 Posts: 15,065 ✭✭✭✭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