Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » .NET Programming (VB 2010 or earlier) » ASP.NET » Response.Write vs. Document.Write


Response.Write vs. Document.WriteExpand / Collapse
Author
Message
Posted 12/28/2009 12:18:52 PM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 9/11/2011 12:23:11 PM
Posts: 77, Visits: 335
Can anyone explain the difference between:

[code]
Response.Write("Hello World")
[/code]

vs.

[code]
Document.Write("Hello World")
[/code]

Also, why would you use those when you can just place a label on the page and use the label text property to fill in what you want????

Thanks in advanced

daveofgv
Post #28590
Posted 12/29/2009 8:37:47 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 6/8/2011 8:59:02 AM
Posts: 19, Visits: 20
Hi

Response.Write is getting executed in Web Server (usually IIS) and is an ASP function which is used to write to response stream from asp.

document.write is javascript function which will be executed on the client side once it reaches the browser.


Thanks,
Paul daniel


.NET Application Development | C# Development
Post #28599
Posted 12/29/2009 4:18:05 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 9/6/2011 8:13:12 PM
Posts: 216, Visits: 156
If it's a simple task such as popping an alert box it's best to use client side javascript, ie. Document.write because it's quicker and you won't be using any web server resources. General rule is if it can be accomplished on the client then only use client side script.

Destroyer
Post #28603
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin, Mod, Mark, Keithuk

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 11:03pm