Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 12-20-2007, 09:12 PM   #1
Default Nested forms and server-side control in ASP.NET


I am designing a web site with a masterpage and a number of child pages. Because Javascript is necessary both for the Masterpage and for the child pages, I have included a single <FORM> tag in the masterpage:

<form id="form1" name="form1" runat="server">

The child pages fit inside this form tag, and do not contain any form tags of their own (to avoid getting an error message stating that I can have only one server side control).

The problem I am having is that Javascript won't recognize any HTML form object from the child pages -- e.g if I try to access a drop down menu with id=”Cause” in one of my child pages, the debugger gets to the following line of Javascript code:

var QuestionList = document.form1.Cause;

and returns the following error message:

“Microsoft Jscript runtime error: ‘document.form1.cause’ is null or not an object”

Any ideas? It won't work to create a second form on the child page and embed the "Cause" drop down menu in that, because then I will need to use a second 'runat="server"' statement -- one on the masterpage, one on the child page -- and will get a message saying the page won't load because there is more than one server side control.


mredelin
mredelin is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46