Results 1 to 6 of 6

Thread: [RESOLVED] reponse.write a web control

  1. #1

    Thread Starter
    Lively Member SpagettiProg's Avatar
    Join Date
    Dec 2004
    Location
    Miami, Florida
    Posts
    82

    Resolved [RESOLVED] reponse.write a web control

    Hi everyone,

    I'm actually trying to do something crazy....

    I have a webpage that reponse.writes tables, data, etc.

    In that page, I have 1 webcontrol that needs to be response written to a specific area during the whole response write process.

    Is this possible? Should I provide more info? Any help is greatly appreciated with rating points.
    If you feel my post has helped, please rate it
    http://www.silentthread.com

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: reponse.write a web control

    Quote Originally Posted by SpagettiProg

    I have a webpage that reponse.writes tables, data, etc.
    Why?

    In that page, I have 1 webcontrol that needs to be response written to a specific area during the whole response write process.

    Web controls use output.write to write when being rendered. What do you mean by 'specific area'? Do you mean inside the control itself or to some other area of the page?

  3. #3

    Thread Starter
    Lively Member SpagettiProg's Avatar
    Join Date
    Dec 2004
    Location
    Miami, Florida
    Posts
    82

    Re: reponse.write a web control

    Quote Originally Posted by mendhak
    Why?
    Because, I'm converting an existing cold fusion page to asp.net.
    I want to keep the original format as the old page. The format varies on the data that is pulled from the database.

    Quote Originally Posted by mendhak
    Web controls use output.write to write when being rendered. What do you mean by 'specific area'? Do you mean inside the control itself or to some other area of the page?
    An area in the page.
    If you feel my post has helped, please rate it
    http://www.silentthread.com

  4. #4
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: reponse.write a web control

    Unless you HAVE to (can't think of a reason though) I'd rethink the way you are doing this and not response.write everything to the page.

    To place controls in specifc area's of the page you can have a placeholder on the page and then in code add your user control to the placeholder.

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: reponse.write a web control

    Quote Originally Posted by SpagettiProg
    Because, I'm converting an existing cold fusion page to asp.net.
    I want to keep the original format as the old page. The format varies on the data that is pulled from the database.



    An area in the page.
    Might as well leave it as it is right now then

    If you want to write to another area of the page, create a function in your web user control that will accept a string. This string will be the ID of a div in another area of your page. You can then use Page.RegisterStartupScript() to call a javascript function which will write to the div's .innerHTML or .innerText property.

  6. #6

    Thread Starter
    Lively Member SpagettiProg's Avatar
    Join Date
    Dec 2004
    Location
    Miami, Florida
    Posts
    82

    Re: reponse.write a web control

    Thanks everyone. I will try Mendhak's suggestions.

    I will also try avoiding the response.write and maybe formating the table through program control in the code behind. (that way, I avoid having to place a control in a specific area of the page)
    If you feel my post has helped, please rate it
    http://www.silentthread.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width