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

Can asp.net 2.0 form in masterpage render ID other than "aspnetFor

I'm porting an asp.net 1.1 app to asp.net 2.0 (july build) and I have a form
in a page that's using a master page. The form inside a content placeholder
looks like:

<asp:Content ContentPlaceHolderID=cphMain runat=server>
<form id=SomeForm runat=server>

on the client, the browser renders:

<form action=thisPage.aspx method=post id="aspnetForm">

so all of my javascript that references "SomeForm.javascriptFct" blows up
because it's not "aspnetForm.javascriptFct".

Any ideas how to make the form render the correct form ID instead of
"aspnetForm" all the time when using a master page?

BTW, it works fine outside of masterpages.

Don

Nov 19 '05 #1
1 1385
Your javascript should dynamically incorporate the ID via ClientID.

As a side note, in general the <form> should be put in the master page, not
the ASPX page.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm porting an asp.net 1.1 app to asp.net 2.0 (july build) and I have
a form in a page that's using a master page. The form inside a content
placeholder looks like:

<asp:Content ContentPlaceHolderID=cphMain runat=server> <form
id=SomeForm runat=server>

on the client, the browser renders:

<form action=thisPage.aspx method=post id="aspnetForm">

so all of my javascript that references "SomeForm.javascriptFct" blows
up because it's not "aspnetForm.javascriptFct".

Any ideas how to make the form render the correct form ID instead of
"aspnetForm" all the time when using a master page?

BTW, it works fine outside of masterpages.

Don


Nov 19 '05 #2

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

Similar topics

7
by: Ray | last post by:
Hi all, I'm new to JavaScript and am trying to create a client side JavaScript form validation script. I'm doing ok with validating text input boxes but have a problem that I have not been able...
2
by: Mark B | last post by:
2nd post: Does anyone know how to set the height of a form passed the inbuilt limit? I want to set the height of a form so that it will fill a portrait page when printing. When the screen...
4
by: anders | last post by:
I have a 'solution' with a Webservice, Business layer and a data layer. In the Business layer I've added a form that need to be started on the server(this site has full rights, runs with Local...
2
by: Brett | last post by:
This article explains that parenting controls is better than adding them to collections:...
4
by: psb | last post by:
not sure if anyone still uses this, but I installed .NetFramework 1.0 sp3 (released, aug31,2004) and after that I was getting some javascript errors. I have a user control inside a webform. ...
4
by: Thomadh | last post by:
I have only updated 1 table with a Form to date Can you update more than 1 table from a single Form input? The Wizard seems to allow only 1 Table to be selected as the data source If so any quick...
0
by: rbmako69 | last post by:
I have a large html table and form, for displaying data and for updating the record data. To make this form look really good, i'm deciding to convert the html form into flash. The page has one...
8
by: fjm | last post by:
Hello all, I know it wouldn't be long before I was back. I have a dilemma and really have no idea where to look for an answer. I have two issues going on and I appoligize in advance if I'm wrong...
7
by: Lenny5160 | last post by:
I have an Access 2003 form with 58 checkboxes. Each checkbox has 2 corresponding combo boxes, which I would like to keep hidden until their box has been checked. The naming is consistent, with the...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.