I've got some problem on some form submit problem.
In a master page, there is a form tag with the "runat=server" attribute, and
a ID called "myForm".
In the contentPlaceHolder under that master page, I cannot create another
form tag with "runat=server" attribute as ASP.NET does not allow two FORM
Server tag in the same page.
The problem now is in the contentPlaceHolder, how to control the "submit"
property of the form tag in the master page.
Thank you.
Siva M - 14 Jun 2007 07:53 GMT
Use the Master property of the page (returns a ref to the master page used by
the current page) and then FindControl on the MasterPage ref to find the form.
Hope this is what you are looking for.
> I've got some problem on some form submit problem.
>
[quoted text clipped - 8 lines]
> property of the form tag in the master page.
> Thank you.
LamSoft - 14 Jun 2007 08:05 GMT
Sorry , I don't understand
I try to use FindControl to find the form, but ... how to write
(Form)Page.FindControl("myForm").onSubmit="abc" gives me no success, the VS
underlined the (Form) and (onsubmit)
> Use the Master property of the page (returns a ref to the master page used
> by
[quoted text clipped - 16 lines]
>> property of the form tag in the master page.
>> Thank you.
Siva M - 14 Jun 2007 08:17 GMT
Try the following code in the Page_Load event of the .aspx page which uses a
master page:
MasterPage mp = this.Master;
HtmlForm form = mp.FindControl ("myForm");
form.Attributes.Add ("onSubmit", "abc();");
> Sorry , I don't understand
>
[quoted text clipped - 22 lines]
> >> property of the form tag in the master page.
> >> Thank you.
LamSoft - 14 Jun 2007 08:31 GMT
Thank you very much.
> Try the following code in the Page_Load event of the .aspx page which uses
> a
[quoted text clipped - 37 lines]
>> >> property of the form tag in the master page.
>> >> Thank you.
bruce barker - 14 Jun 2007 16:29 GMT
use ClientScript.RegisterOnSubmitStatement
-- bruce (sqlwork.com)
> I've got some problem on some form submit problem.
>
[quoted text clipped - 8 lines]
> property of the form tag in the master page.
> Thank you.