Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 September 23rd, 2007, 11:23 PM
Registered User
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Some help required !

Hi Everyone, Some help required :-

There is a website "www.mywebsite.com". Each time a link is opened, a form action is generated dynamically .The form consists of two button with the same name "mybutton", but the value of each button is different.I want to submit the form automatically( using either the WebBrowser component or the HTTPWebRequest class), whenever the user enters the main url in a textbox.


User enters www.mywebsite.com/1234.html, then a page is shown with the form with <form "action"="www.abc.mywebsite.com/1234.html">and the two buttons, <input type=submit name="mybutton" value="button1"> and <input type=submit name="mybutton" value="button2">.

If there is some other link like www.mywebsite.com/87878.html then the form action changes..

So basically I need to do the following

1).Get the form action of the URL entered by the user.
2).Submit the form with the method POST.

I searched a lot for some help on the topic, but as I couldn't, I am asking for help. Thank you. :)
Old September 24th, 2007, 04:01 PM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

You wouldn't submit any useful data to the new page if all the form contains is 2 buttons. In any event, I wouldn't render a form dynamically. I would provide a text box and 2 buttons like you stated above but I would use the buttons click event handler and post to the page listed in the textbox using a WebRequest/Response.

Look into HttpWebRequest and HttpWebResponse

================================================== =========
Read this if you want to know how to get a correct reply for your question:
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help required zaeem SQL Server 2000 2 May 28th, 2008 12:48 AM
SQL help required Teessider_2000 MySQL 1 January 10th, 2007 02:15 AM
No value given for one or more required parameters ableton ADO.NET 2 July 18th, 2006 02:12 AM
Is it required to use Apache? marjan Beginning PHP 3 March 9th, 2004 07:18 PM
Required files help please sdig BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 4 June 7th, 2003 09:46 AM

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