|
-
Jan 5th, 2008, 11:13 AM
#1
Thread Starter
Addicted Member
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:
Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
output.WriteBeginTag("input type = 'button'")
output.WriteAttribute("value", "close me")
output.WriteAttribute("onclick", "javascript: closeme();")
output.WriteEndTag("input")
End Sub
-
Jan 6th, 2008, 05:17 PM
#2
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.
-
Jan 6th, 2008, 10:20 PM
#3
Thread Starter
Addicted Member
Re: Response.Write versus output.Write-render method
-
Jan 7th, 2008, 04:35 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|