PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?ZG9uanVhbg==?=
Guest
Posts: n/a
 
      17th Aug 2005
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

 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      17th Aug 2005
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
>




 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
enctype="multipart/form-data" for MasterPage =?Utf-8?B?QWxleCBNYWdoZW4=?= Microsoft ASP .NET 2 15th Aug 2007 07:31 AM
RenderControl on MasterPage - "must be placed inside form tag" err =?Utf-8?B?Qm9i?= Microsoft C# .NET 0 26th Jul 2007 05:00 PM
MasterPages - take plain form, add MasterPage. MasterPage does NOT appear when run Randy Smith Microsoft ASP .NET 8 14th Apr 2007 10:06 AM
MasterPage -> Page -> MasterPage Code Access =?Utf-8?B?QWxleCBNYWdoZW4=?= Microsoft ASP .NET 3 14th Apr 2006 01:34 PM
Form within a MasterPage on Whidbey Frank Rizzo Microsoft ASP .NET 5 12th Apr 2004 04:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:28 PM.