Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to post forms correctly 1

Status
Not open for further replies.

romh

Programmer
Jan 3, 2003
297
US
I am creating an .aspx page that displays a summary of all the collected information from a user, which then posts to a credit card gateway. I need 2 form tags:

<form runat="server">
</form>

and

<form> action=" method="post">

</form>


i'm using a service called yourpay.com

yourpay.com looks for certain text fields inside the 2nd form tags (Name, Card Number, etc...).
Anyway, the problem is that I don;t know how to populate the text fields inside the 2nd <form> tag which doesn;t have a runat=sever tag.

Thanks
 
i GUESS MY question is the following.

How can I post a .aspx page to somewhere else other than that same page?
I need to fill in certian Text Boxes to specific values programatically.

Thanks
 

Use this form if you can have other variables floating around in your form.

Otherwise, override the .Render() method of your page class, and do something like this:

protected override Render(...)
{
base.Render(writer);

StringBuilder sb = new StringBuilder();
sb.Append("<form name=anotherform method=post action=anotherpage.aspx>");
sb.Append("<input type=hidden name=var value=val>");
sb.Append("</form>");
writer.Write(sb.ToString());

}//Render

Let the framework write out the page by calling base.Render(), and then just add your own output to the stream.

good luck.

-p

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top