473,397 Members | 1,949 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,397 software developers and data experts.

aspnetForm

How do I assign a name to the form element in a master page/ child page
situation?

I have included a name= in my form declaration...asp.net always changes it
to aspnetForm. Is there a way to override that behavior and apply my own
name?
Oct 1 '08 #1
4 1840
"Ron" <Ro*@discussions.microsoft.comwrote in message
news:BB**********************************@microsof t.com...
Is there a way to override that behavior and apply my own name?
No.

Why do you think you need to to this, AAMOI...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 1 '08 #2
I am building an application that uses a lot of Javascript. A lot of the
Javascript is adopted from another application and the form name is set.

There are numerous postbacks. Trying to reference the various elements with
all of the mangling going on is very difficult…I have eliminated all of the
controls (in favor of straight HTML), however, the use of master pages
requires the use of a runat-server form.

It is amazing to me...I don't understand why Microsoft tries to make a web
page development system look like a desktop development system. It just adds
a lot of complexity that has to be overcome if the developer does anything
that is "outside the box". I have worked with .net since before version 1.0
was released, and I have also worked with ColdFusion, PHP, and Perl. The
other development systems are a lot easier when an application comes along
that requires a lot of client side javascript.

"Mark Rae [MVP]" wrote:
"Ron" <Ro*@discussions.microsoft.comwrote in message
news:BB**********************************@microsof t.com...
Is there a way to override that behavior and apply my own name?

No.

Why do you think you need to to this, AAMOI...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 2 '08 #3
"Ron" <Ro*@discussions.microsoft.comwrote in message
news:33**********************************@microsof t.com...
>>Is there a way to override that behavior and apply my own name?

No.

Why do you think you need to to this, AAMOI...?

I am building an application that uses a lot of Javascript. A lot of the
Javascript is adopted from another application and the form name is set.

There are numerous postbacks. Trying to reference the various elements
with
all of the mangling going on is very difficult…I have eliminated all of
the
controls (in favor of straight HTML), however, the use of master pages
requires the use of a runat-server form.
In ASP.NET, there can only be one server-side form (i.e. a <formelement
with the runat="server" tag), and its name will always be aspnetForm.

You don't need to specify the form container name to work with one of its
elements in client-side JavaScript.

E.g. if you have an <asp:TextBox /web control called "MyTextBox, you would
do something like:

document.getElementById('<%=MyTextBox.ClientID%>') ;
It is amazing to me...I don't understand why Microsoft tries to make a web
page development system look like a desktop development system. It just
adds
a lot of complexity that has to be overcome if the developer does anything
that is "outside the box". I have worked with .net since before version
1.0
was released, and I have also worked with ColdFusion, PHP, and Perl. The
other development systems are a lot easier when an application comes along
that requires a lot of client side javascript.
I disagree completely.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 2 '08 #4
Thanks!

"Mark Rae [MVP]" wrote:
"Ron" <Ro*@discussions.microsoft.comwrote in message
news:33**********************************@microsof t.com...
>Is there a way to override that behavior and apply my own name?

No.

Why do you think you need to to this, AAMOI...?
I am building an application that uses a lot of Javascript. A lot of the
Javascript is adopted from another application and the form name is set.

There are numerous postbacks. Trying to reference the various elements
with
all of the mangling going on is very difficult…I have eliminated all of
the
controls (in favor of straight HTML), however, the use of master pages
requires the use of a runat-server form.

In ASP.NET, there can only be one server-side form (i.e. a <formelement
with the runat="server" tag), and its name will always be aspnetForm.

You don't need to specify the form container name to work with one of its
elements in client-side JavaScript.

E.g. if you have an <asp:TextBox /web control called "MyTextBox, you would
do something like:

document.getElementById('<%=MyTextBox.ClientID%>') ;
It is amazing to me...I don't understand why Microsoft tries to make a web
page development system look like a desktop development system. It just
adds
a lot of complexity that has to be overcome if the developer does anything
that is "outside the box". I have worked with .net since before version
1.0
was released, and I have also worked with ColdFusion, PHP, and Perl. The
other development systems are a lot easier when an application comes along
that requires a lot of client side javascript.

I disagree completely.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 2 '08 #5

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

Similar topics

2
by: bm | last post by:
Does anyone know how to get a form's name to be anything other than "aspnetform" when using master pages? Thanks, Brent beta 2
9
by: Alan Silver | last post by:
Hello, I have some simple client-side Javascript validation that was working fine until now. For some reason (don't ask me), it has stopped working and I can't figure out why. I have switched to...
4
by: Greg | last post by:
I'm guessing the problem I'm having has something to do with Master Pages or DetailsView because the exact same code works fine on a page without a Master Page and DetailsView controls. The...
0
by: Mark Rae | last post by:
Hi, Is there anyway to force a master page to retain the name of the form as programmed instead of changing it to aspnetForm? According to all the articles I've found on this so far:...
2
by: ccgatvolvo | last post by:
Here is the rendered output from my page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
23
by: Mark Rae | last post by:
Hi, Because all my public sites are hosted with a 3rd-party ISP and, therefore, I don't have access to their server's EventLog etc, every error is emailed to me. Recently, I've been getting...
11
by: -Lost | last post by:
I was perusing some code and saw: var theForm = document.forms; if (!theForm) { theForm = document.aspnetForm; } Is this a waste of code? Or is there some instance where bracket notation...
33
by: phfle1 | last post by:
Hi, I want to display the cursor as an hourglass on the click of a button in the form and use the following line to achieve that Me.btnRecherche.Attributes.Add("onclick",...
12
maliksleo
by: maliksleo | last post by:
Hi All i have a div tag of 100% height and width with opacity filter but when i use it, it shows height half of the page means it covers half page and leave the other half. can any body solve my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.