Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

FORM TAG Problem.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LamSoft - 14 Jun 2007 07:28 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.