Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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
  #1 (permalink)  
Old April 9th, 2004, 06:20 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default HTTP-POST with C#

I understand the use of passing values on the query string and calling the array and getting the value, HTTP-GET. What I don't know how to do is make an HTML link (<a>) pass a value to an .aspx page not using the query string. And then accessing the values on the target page. This may or may not be capable with an HTML link I may have to use a Visual Studio defined control. Any help or direction would be appreciated.

  #2 (permalink)  
Old April 10th, 2004, 12:12 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you are looking to use just an <a> link then you are left with the single option of the querystring.

Peter
-------------------------
Work smarter, not harder
  #3 (permalink)  
Old April 11th, 2004, 06:12 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

so I cannot post through <a> that sux. but how can i specify which values my asp:button posts? and how do I access them on the other end?

  #4 (permalink)  
Old April 12th, 2004, 01:15 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Let's clarify something:

An <a> by itself can not post. However, an <a> associated with a form can most certainly post. Take this example:

<form action="postDestinationPage.aspx" method="post" name="myPostForm">
   <input type="hidden" name="hidSomeHiddenValue" value="12345">
   <a href="javascript:document.myPostForm.submit();">Cl ick Me</a>
</form>

When you click the link in this form, the form is posted to the page specified in the action attribute. This is actually how .net works for some controls, particularly when you use a LinkButton control. Regular hyperlinks are drawn, but instead of URLs that point to other pages, they point to javascript code that posts back the page.

Are you looking to create isolated hyperlinks that post to pages outside of your .net web application or are you just interested in having a link act as a button on a .net web form? If the latter is the case, then you can use the LinkButton control. This results in behavior identical to a regular button but with a hyperlink instead.

Peter
-------------------------
Work smarter, not harder


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on HTTP Post dgrumbli BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 December 20th, 2006 02:03 PM
Http Post issue Phoenixheart C# 0 November 6th, 2006 03:54 AM
HTTP post silver_scar C# 2005 0 July 31st, 2006 09:52 AM
HTTP POST/GET d_alchemist JSP Basics 1 April 24th, 2006 09:18 AM
HTTP Post .Net sjlsysprg1 Pro VB.NET 2002/2003 5 June 26th, 2003 12:20 PM





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