473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How do I create and post an html page from code behind in vb.net?

HI, I have a NameValueCollection in vb.net and I need to be able to iterate through it and create an html form that posts automatically to a 3rd party site.

I have this to go off of as an example, but I am not sure exactly how to do this from code behind and end up with an html page that actually posts. Maybe I'm missing the obvious but I'm relatively new to .net and help would be greatly appreciated!
Expand|Select|Wrap|Line Numbers
  1. StringBuilder sb = new StringBuilder();
  2.  
  3. sb.Append("<html>");
  4.  
  5. sb.AppendFormat(@"<body onload='document.forms[""form""].submit()'>");
  6.  
  7. sb.AppendFormat("<form name='form' action='{0}' method='post'>",postbackUrl);
  8.  
  9. sb.AppendFormat("<input type='hidden' name='id' value='{0}'>", id);
  10.  
  11. // Other params go here
  12.  
  13. sb.Append("</form>");
  14.  
  15. sb.Append("</body>");
  16.  
  17. sb.Append("</html>");
  18.  
  19. Response.Write(sb.ToString());
  20.  
  21. Response.End();
  22.  
Mar 30 '11 #1
1 4325
I figured it out and have it working. Thanks!
Mar 31 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Nick Li | last post by:
Hi, I need to create a html page so that "Back" button(or some other button) is disabled in IE browser. I would appreciate your help. Nick Li
0
by: Paul | last post by:
I am creating a Program for college, in which the Program will read a Folder and create a HTML page from the pictures that are storrd in that folder. .. What would be the best way to do it in VB...
5
by: VB Programmer | last post by:
Here's the quick situation: 1. Using VS.NET I create 1 fully functioning aspx page, with code behind. (Simple webform: It has a few text boxes, 1 hyperlink, 2 and buttons.) 2. I uploaded it to...
2
by: N. Demos | last post by:
I have a user control with code behind of which two instances are created/declared in my aspx page. The aspx page has code behind also, as I need to access methods of the usercontrols on page...
4
by: philippe merrien | last post by:
hello, I would like to modify the content of my html page from the code behind. But i've got a problem...I know how to get the html from a spécific control (thanks to FindControl) but what...
2
by: Michael Raczynski | last post by:
Hey guys, Apologies if this is in the wrong thread, whenever I search for <% or "switching context" I get no results. What I am trying to do is set the value of a html text box to a server...
2
by: Mark | last post by:
In ASP.NET 1.x a codebehind file X could inherit from class Y assuming that Y inherited from System.Web.UI.Page. In ASP.NET 2.0 this appears to be problematic since the previous codebehind is now...
2
vijcbe
by: vijcbe | last post by:
Hello friends, I wish to create a new HTML page, using a PHP coding. The name of the HTML page should be of user's wish. Someone please help me doing it. Thanks a million, VJ
4
by: CSINVA | last post by:
Trying to figure out how to do a cross post page within the code behind file. I need to do some calculations before I send a string value to another pages. Here is an example of the concept I...
0
by: beulajo | last post by:
I have few agreement forms to be filled by the user. Right now I have all the agreement forms in separate word document and it is a manual work. I want to automate this system of filling the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.