473,665 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MVC, nested masterpage and Javascript

Hi.

Is there a problem when trying to use Javascript on a nested masterpage?

On my masterpage, i've got this in the <head>:
<asp:ContentPla ceHolder ID="HeadContent " runat="server" />

And on the nested masterpage:
<asp:Content ID="Content1" ContentPlaceHol derID="HeadCont ent" runat="server">
<asp:ContentPla ceHolder ID="NestedHeadC ontent" runat="server" />
</asp:Content>

And on my content page page:
<asp:Content ID="Content1" ContentPlaceHol derID="NestedHe adContent"
runat="server">
... .js includes goes here ...
<script type="text/javascript">
$(function()
{
$('.startDate-pick').datePick er({startDate:' 01/01/1996'});
});
</script">
</asp:Content>

And in the body of the nested page, i've got this input field with the class
used above:
<input id="startDate" name="startDate " type="text" size="7"
class="startDat e-pick" />
This works on content pages within the masterpage, but not on content pages
within the nested masterpage. Why is that, and what can I do about it?

Thanks in advance.

Tommy
Sep 13 '08 #1
0 1681

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

Similar topics

2
2459
by: iturner100 | last post by:
Hi, I've been struggling with this one for a couple of hours without much joy. Basically, I've got a set of nested masterpages (3 as it happens). I'm dynamically generating a new page in code and want to be able to populate the ContentPlaceholders of the inner-most masterpage at run-time.
0
1098
by: VB Programmer | last post by:
I used Photoshop/Image Ready to create rollover buttons (for a nav menu). They work great. But, when I take the html, including the javascript and put it in a MasterPage, when I view the page (based on the Master) the rollovers don't occur. Any ideas why? Is the Javascript supposed to work even when in a Master Page? Here's the partial HTML for the master... The javascript was created automatically in Image Ready, so not to much of...
2
1202
by: delvsb | last post by:
Hi. I would like to ask whether it is normal that you cannot view the child master page in the design view when using nested masterpages. ex. i have the ff files maintemplate.master template1.master whose masterpagefile is maintemplate.master i cannot display template1.aspx in design view
1
4509
by: rockdale | last post by:
Hi, I have a page which use a masterpage. And I put a javascript in this page like below: <%@ Page Language="C#" MasterPageFile="~/SITE.master" CodeFile="TEST.aspx.cs" Inherits="TEST_aspx" Title="TEST Javascript" %> <script type="text/javascript" language="javascript"> DOING SOMETHING WITH OBJECTS THAT EXIST ONLY IN TEST PAGE BUT NOT IN MASTER PAGE
8
3033
by: =?Utf-8?B?QW1yaXQgS29obGk=?= | last post by:
Okay, after much research, I have discovered a few interesting things in ASP.NET. I have a MasterPage that has a WebForm on it and it looks like this: <body> <form id="controls" runat="server"> <div id="bodyColumn"> <asp:ContentPlaceHolder id="bodyContentPlaceHolder" runat="server"> </asp:ContentPlaceHolder>
4
1591
by: daveh551 | last post by:
I've seen reference to Nested Master Pages in some of the documentation, but I haven't been successful in creating one in VS 2005 (Framework 2.0). I just did a search on it, and "How To: Walkthrough" on Master pages listed VS 2008 and Framework 3.5 as pre- requisites. If I do an "Add New Item" selecting "Master Page", the "Use MasterPage" check box is grayed out, so it won't let me create it in VS 2005. Is there a way to "trick it"? ...
1
2058
by: daveh551 | last post by:
Okay, another problem I'm having with nested master pages on VS 2005. I've got a MasterPage,master, as SubMaster.master, and a DesignTime.master, and a content page, default.aspx. The DesignTime master is a single level master page incorporating both the content of the MasterPage and the SubMaster, so that I can get around the fact that you can't see content pages in Design mode if they use nested masters.
2
6751
by: kurt sune | last post by:
Hello, I have a weird problem, I hope someone can explain this for me. I have a webpage using masterpage. In it I create a popup window using this code: Dim js As String = "<script language=javascript>" js &= "var newWin = window.showModalDialog('InkommetVi.aspx" js &= "',null,"
16
11612
krungkrung
by: krungkrung | last post by:
Hi all, Can somebody help me figure out whats wrong with my program? I created a site with the use of MasterPage..and with a plan of utilizing and abusing the capabilities of AJAX, I added the ScriptManager to create PageMethods. Here's what I did: 1. I added the "ScriptManager" and the "JavaScript that calls the page method" in MasterPage...with Javascript inside the <body> tag and ScriptManager inside the <form> tag.
0
8348
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
8863
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
8549
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
8636
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4186
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
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1761
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.