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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add "submit button" in htmlform control?

Status
Not open for further replies.

someTimeOnly

Technical User
Oct 12, 2003
78
PK
say what is the equivalent code of the following code

Code:
response.Write("<form id='myID' method='post' action='that.aspx>")

using htmlform and adding to it an htmlinputbutton control to post the data.


 
>>response.Write("<form id='myID' method='post' action='that.aspx>")


i dont get it why are u using response.write() to write out the form?

to add controls(even forms) u have to use the Controls.Add method...

Known is handfull, Unknown is worldfull
 
hm, I think I couldn't make my problem clear. Acutally, I'm not using response.write for creating form. Instead, I'm asking an equivalent of this.
Code:
Write("<form id='myID' method='post' [COLOR=red]action='that.aspx [/color]>") using the following approach.

I'm coding things this way.
Code:
// Create a new HtmlForm.
HtmlForm form = new HtmlForm();
form.ID = "ButtonForm";
form.Method = "post";
			
HtmlTable table = new HtmlTable();
table.ID = "table1";
table.CellSpacing = 3;
table.Border = 0;

HtmlTableRow tr;
HtmlTableCell td;
.
.
.

Now, I'm asking that how to fire action method of form, which will post data to a different page(even not sure about to same page).
 
>>Now, I'm asking that how to fire action method of form, which will post data to a different page

cannot be done.

>>to the same page

u can use a submit button or use javascript, try this:
document.forms[0].submit()

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top