Results 1 to 4 of 4

Thread: Response.Write versus output.Write-render method

  1. #1

    Thread Starter
    Addicted Member silentthread's Avatar
    Join Date
    Jun 2006
    Location
    Miami, Florida
    Posts
    143

    Response.Write versus output.Write-render method

    Hi,

    What is the difference between response.writing a control onto a page, versus creating a WCC that has a render method, and doing something like this....

    code Code:
    1. Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
    2.  
    3.         output.WriteBeginTag("input type = 'button'")
    4.         output.WriteAttribute("value", "close me")
    5.         output.WriteAttribute("onclick", "javascript: closeme();")
    6.         output.WriteEndTag("input")
    7.  
    8.     End Sub
    Watch media as you download it! Excellent tool!
    FREE CUBA!
    MyBlog
    If you feel my post has helped, please rate it.

  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: Response.Write versus output.Write-render method

    The difference is how and where you write them, the similarity is the unmaintainability and inflexibility of the code created.

    Response.Write writes to the stream at the point at which it is called in code, so the text can show up anywhere. Render()->output.write... is more controlled in that it is called when it is invoked at a point that you, the developer want. A web user control acts as a proper ASP.NET control and separates the UI from the UI logic and is rendered at the position it is placed in on the page.

  3. #3

    Thread Starter
    Addicted Member silentthread's Avatar
    Join Date
    Jun 2006
    Location
    Miami, Florida
    Posts
    143

    Re: Response.Write versus output.Write-render method

    You are the best!
    Watch media as you download it! Excellent tool!
    FREE CUBA!
    MyBlog
    If you feel my post has helped, please rate it.

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

    Re: Response.Write versus output.Write-render method

    That's what she said to me... before she took my house.

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