473,780 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ContentPlaceHol derID=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.javas criptFct" blows up
because it's not "aspnetForm.jav ascriptFct".

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 1399
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 ContentPlaceHol derID=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.javas criptFct" blows
up because it's not "aspnetForm.jav ascriptFct".

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
1414
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 to solve and one I hope someone will help me resolve. I want to check the contents of a drop down box and if a certain item is selected, check the contents of a text input box to see if a any text was entered. If no text is entered, I want to...
2
4182
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 resolution is <= 1024x800, the fm.InsideHeight is capped by Access so that the height is reduced.
4
7694
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 System account), th BL is called from the WS. So in my Business layer I've added code to start and close the form, but I get the error: "It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode....
2
1158
by: Brett | last post by:
This article explains that parenting controls is better than adding them to collections: http://msdn.microsoft.com/smartclient/understanding/netcf/dev/default.aspx?pull=/library/en-us/dnnetcomp/html/netcfimproveformloadperf.asp. However, it doesn't explain why. Please elaborate why parenting is better than using collections. Thanks, Brett
4
1592
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. basically have login.ascx inside login.aspx. the login.ascx contains the <form> tag. <form id="Form1" runat="server"> before the sp3 the form would render like this...
4
4071
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 pointers would be useful Many thanks
0
2638
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 large table with smaller tables inside. Each of the smaller tables pull from one table in my database, and each one has its own update button and action page. What i'm trying to do is change the layout using a flash form, and either each tab or...
8
1837
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 for putting them both into one single post. My first question has to do with more of a design issue than anything else. I have an html form that will be populated with data from a mysql database using php. My *insert* form has the basic name,...
7
2317
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 checkboxes named "chkName" and the combo boxes named "cboName_Rating" and "cboName_Duration". Since there are so many checkboxes, I want to eliminate having to put a function call in the AfterUpdate event of each one. Here is what I am trying to...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10075
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.