473,406 Members | 2,549 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,406 software developers and data experts.

FORM TAG Problem.

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.


Jun 14 '07 #1
5 2087
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.

"LamSoft" wrote:
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.


Jun 14 '07 #2
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)
"Siva M" <sh******@online.excite.comwrote in message
news:84**********************************@microsof t.com...
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.

"LamSoft" wrote:
>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.



Jun 14 '07 #3
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();");

"LamSoft" wrote:
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)
"Siva M" <sh******@online.excite.comwrote in message
news:84**********************************@microsof t.com...
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.

"LamSoft" wrote:
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.




Jun 14 '07 #4
Thank you very much.
"Siva M" <sh******@online.excite.comwrote in message
news:0E**********************************@microsof t.com...
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();");

"LamSoft" wrote:
>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)
"Siva M" <sh******@online.excite.comwrote in message
news:84**********************************@microso ft.com...
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.

"LamSoft" wrote:

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.





Jun 14 '07 #5
use ClientScript.RegisterOnSubmitStatement

-- bruce (sqlwork.com)
LamSoft wrote:
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.

Jun 14 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Paradigm | last post by:
I am using an Access2K front end to a MYSQL database. If I enter a new record in a continuous form the record appears as #deleted as soon as I move to a different record in the form until I requery...
2
by: Chris | last post by:
Hi, I'm new to ASP.Net and Crystal but I've been playing with some samples and have run into a problem. If I put all my code into the Page_Init sub of a single form and run that form, the...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
1
by: crawlerxp | last post by:
Does anyone know what is the problem here: I have installed IIS and asp.net 1.1 on windows XP SP1. asp.net 1.1 is a production not development version I downloaded from ms site. Welll this is...
0
by: Sakharam Phapale | last post by:
Hi All, I am developing an application which works similar to MS WORD. I have a main form which acts as MDI container and I am using a third party menu control so that it looks like XP style...
2
by: zoneal | last post by:
Ok I got 3 problems and I aint very good at this, but here goes. First problem: I got an application with an listbox and a richtextbox and three buttons, when I press the diffrent button the...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
4
by: asad.naeem | last post by:
hi to all this is the problem about inheritence. I have designed a form with some essential controls which are required for every form which will inherited from it. for example i have Button1 on...
4
by: erick-flores | last post by:
Hello I am using an If statement to test if a field = IsNull then close that form and open another one. Here is the code: Private Sub Form_Load() If IsNull(Me.loc_fk) Then MsgBox "This...
17
by: radio1 | last post by:
Configuration: Access 2002 and SQL Server 2000 using a .ADP Project. I would VERY MUCH appreciate anyone's input into this problem I'm having. I have a form in Access that does not permit...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.