Try:
Page_Load
'vb.net
dim form as HtmlForm = ctype(FindControl("form1"), HtmlForm)
//c#
HtmlForm form = (HtmlForm)FindControl("form1");
end
where "form1" is the id you've given to your form tag (ie, <form id="form1"
runat="server" > )
If that's still to "hard-coded" for you...you'll need to loop through the
page controls and look for the control
public function GetPageForm(byval parentControl as Control) as HtmlForm
for each child as Control in parentControl.Controls
if typeof child is HtmlForm
return ctype(child, htmlForm)
end if
next
return nothing
end function
you might need to make the above code recursive though...if the htmlform is
embedded (unlikely)..
anyways...seems like overkill...Brock's suggestion should be the right way
to go unless there are very special circumstances..
Karl
P.S. - Hi Brock