Click here to Skip to main content
15,911,646 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to Disable Validation Events? Pin
Dipan Patel From Gandhinagar6-May-06 2:59
Dipan Patel From Gandhinagar6-May-06 2:59 
QuestionAfter moving ASPX page to a live server this happens. Pin
evlxtc4-May-06 2:02
evlxtc4-May-06 2:02 
QuestionHow to retain radio button check (Urgent) Pin
indiaone4-May-06 1:59
indiaone4-May-06 1:59 
AnswerRe: How to retain radio button check (Urgent) Pin
R.Prabha Devi4-May-06 2:39
R.Prabha Devi4-May-06 2:39 
QuestionPopulate input control on external web page? Pin
mattdavies4-May-06 1:19
mattdavies4-May-06 1:19 
AnswerRe: Populate input control on external web page? Pin
minhpc_bk4-May-06 16:15
minhpc_bk4-May-06 16:15 
GeneralRe: Populate input control on external web page? Pin
mattdavies4-May-06 23:46
mattdavies4-May-06 23:46 
GeneralRe: Populate input control on external web page? Pin
minhpc_bk7-May-06 17:36
minhpc_bk7-May-06 17:36 
mattdavies wrote:
However, I couldn't work out or find and examples of how you can use this object to populate a web control with data and submit the page.


Hi Matt,
In fact, you don't use the HttpWebRequest to populate a web control, instead you use it to send data to a specified URL with the Post/Get method. Let me briefly describe it in a couple of steps in order to make it clear:

- Use the HttpWebRequest object to make a request to a specified URL.
- Read the output html markup from the HttpWebResponse object.
- You can choose a value for an input element from the retrieved html markup by using the regular expression, I mean you can use the Regex class to process the markup to select a value for an element like the dropdownlist, for the TextBox, you no need to process the markup.

Another way to visually choose a value for the input element is that you load the result html markup to a web browser control, then use the document object of the browser control to populate the input element.

- Arrange the data that you're gonna submit in the expected format, then use the HttpWebRequest object to submit data to the destination URL.


Like I said in the previous post, in addition to the HttpWebRequest object, you can also use the web browser control to navigate to a specified URL, and access the document object of the control, then you are able to get reference to the input control to populate it, it simulates the way you select a value for the input control in the browser.



mattdavies wrote:
Would you need to use the HttpWebResponse object in conjuction with the HttpWebRequest object?



You normally use the HttpWebRequest to make a request to a specified URL to get info, and then in order to read the result html markup sent back from the server you will use the HttpWebResponse object (which is accessed from the GetResponse method of the HttpWebRequest object that you use to make a request earlier).
GeneralRe: Populate input control on external web page? Pin
mattdavies22-May-06 22:58
mattdavies22-May-06 22:58 
QuestionUrgent help with Textboxes!!! Pin
Commickey4-May-06 1:18
Commickey4-May-06 1:18 
AnswerRe: Urgent help with Textboxes!!! Pin
mattdavies4-May-06 1:28
mattdavies4-May-06 1:28 
GeneralRe: Urgent help with Textboxes!!! Pin
Commickey4-May-06 1:31
Commickey4-May-06 1:31 
AnswerRe: Urgent help with Textboxes!!! Pin
Nasums4-May-06 4:23
Nasums4-May-06 4:23 
AnswerRe: Urgent help with Textboxes!!! Pin
RichardGrimmer4-May-06 5:59
RichardGrimmer4-May-06 5:59 
QuestionCookie problem in ASP.NET 2.0 Pin
Flavian Gheorge4-May-06 0:22
Flavian Gheorge4-May-06 0:22 
QuestionWebControl and Designer Display problem Pin
smoitry3-May-06 23:28
smoitry3-May-06 23:28 
QuestionHow to draw a rectangle on a webpage? Pin
KaKa'3-May-06 23:16
KaKa'3-May-06 23:16 
Questionhow to get Server IP Address? Pin
haneen19843-May-06 23:15
haneen19843-May-06 23:15 
AnswerRe: how to get Server IP Address? Pin
R.Prabha Devi4-May-06 1:55
R.Prabha Devi4-May-06 1:55 
GeneralRe: how to get Server IP Address? Pin
haneen19844-May-06 2:35
haneen19844-May-06 2:35 
QuestionJavaScript Pin
Uma Kameswari3-May-06 23:10
Uma Kameswari3-May-06 23:10 
AnswerRe: JavaScript Pin
kirthikirthi4-May-06 0:15
kirthikirthi4-May-06 0:15 
GeneralRe: JavaScript Pin
Uma Kameswari4-May-06 21:46
Uma Kameswari4-May-06 21:46 
Questionfavorites??? Pin
students552 university3-May-06 23:03
students552 university3-May-06 23:03 
AnswerRe: favorites??? Pin
sathish s3-May-06 23:13
sathish s3-May-06 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.