Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 1st, 2003, 08:37 PM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to properly display data from a post

A question on basic usage for a learner.

So far I've discovered you can display user data posted to a form in one of two ways. The book (ASP 3.0) says to use a dim and display that...

<%@ Language=VBScript %>
dim strData
strData = Request.Form("data")
<HTML>
<BODY>
<%=strData%>
</BODY>
</HTML>

...but requesting the data directly from the form seems to work just as well...

<%@ Language=VBScript %>
<HTML>
<BODY>
<%Response.Write Request.Form("data")%>
</BODY>
</HTML>

The second way seems cleaner but I haven't seen this as an example in the book. (I'm only at page 113.)

Is there a reason for this? Is it 'bad form'?

TIA,
Mike

 
Old August 5th, 2003, 01:27 PM
Authorized User
 
Join Date: Aug 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I really dont see why you 'should' and 'shouldnot' do in either ways, but the first one has its own advantages, like for a scenario where you are passing the same value through multiple forms(that is from the page where the form value is written to another page)or anything specific where you want to use/refer a variable, probably storing the value in a variable would be a good approach, other than that i think its a waste creating a varible for the sole purpose of displaying it!!!


Chintu





Similar Threads
Thread Thread Starter Forum Replies Last Post
Submitting POST data without a form takabyte Classic ASP Basics 15 April 28th, 2014 01:44 AM
datagrid does SORT integer data properly chayanvinayak Flash (all versions) 3 July 27th, 2006 02:59 PM
Using XMLHTTP to POST form data channer Classic ASP XML 8 January 6th, 2004 05:44 AM
Ch05 IE not properly display XML david_4092 BOOK: Beginning ASP.NET 1.0 1 October 24th, 2003 01:23 PM
Display message between post to asp wlangel Classic ASP Basics 1 September 8th, 2003 04:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.