.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

jquery with master pages

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net

i have an application that uses a master page.  i have an asp textbox named "TextBox1" on one of the subpages.

i have the following script code in my java script function:

var ti = document.getElementById("TextBox1");

View Complete Post

More Related Resource Links

jQuery and Master Pages - Object expected


Here is the layout of my problem: I have a Master Page that is referenced by pages in the root of my site, as well as some pages in an 'Admin' folder. All of that works just fine. I added some jQuery to add some features to an auto-search textbox, and placed the code referencing the jQuery file and the script in the head section of the Master Page. The script looks a little like this:  

       SelectText(this); // Function to call on click event.

I just used the actual id generated by ASP.NET to grab the textbox to avoid the "what's the actual id?" issues. When the home page loads, all is well. When I try to navigate to one of the pages in the 'Admin' folder, I get an 'Object expected' error. At first I thought it was due to a possible renaming of my textbox, but I checked the source of the page and this was not the case. In fact, I removed all of the script code except the:


part, and the 'Object expected' error still occurs. I am only setting up the jQuery here, and it still throws an exception. I have no idea what is causing

Master-Detail with the GridView, DetailsView and jQuery's ThickBox

One more article about grids from Matt Berseth. This time he shows how to create master-detail with the gridview, detailsview and jQuery's ThickBox. He writes:
So I thought I would check some of this out and along the way rebuild my Master-Detail with the GridView, DetailView and ModalPopup Controls and replace the ModalPopup with jQuery's ThickBox. I found it pretty interesting - read on to see how it went

Master-Detail with the GridView, DetailView and jQuery's ThickBox

An example of using the jQuery ThickBox with ASP.NET's GridView and DetailView controls

Master Pages in MOSS 2007

'MasterPages' feature in sharepoint 2007 makes the entire customization job easy.In 2003 we used to face lot of issues to get the same look and feel and the standard behaviour for overall site. In 2007, customizing the look and feel for the entire site can be done in a simple way by using 'MasterPage' feature.

Master Pages: Master Your Site Design with Visual Inheritance and Page Templates


Master pages in ASP.NET 2.0 solve a problem many Web developers have been solving on their own with a variety of techniques for years - providing a single master template for an entire site. This article covers the details of master pages, discussing their usage and implementation and how they are a natural evolution of custom techniques developers are using today.

Fritz Onion

MSDN Magazine June 2004

Button click in master page use in other pages I have to click twice. Why?


In my masterpage I have a menu with buttons. I want the buttons to do something after click. It works but I have to click twice on the button, why? What do I have to do to just to click once?

how to change default menu tab in master pages?



i have 5 tabs in my master page application. how can i make 2nd tab as default?

any ideas?


Ajax and master pages


I have a site that uses master pages.  Some of my pages use ajax, so they have the scriptmanager on them.  I now have to add some ajax to one of the master pages.  When I try to display a page that already has a script manager on it, I get an error that I can only have one script manager.  Is there a way to deal with this other then searching for every page that uses the master page and ajax and removing the scriptmanager tag? 

I'm hoping to start using Ajax more and more, so I'm really more concerned with best practices then I am about having to find and remove tags.  What is the right way to use Ajax on master pages and some, but not all content pages?

Why do the aks master pages not get applied if the feature is not activated on the top site collecti


I installed AKS 2.0 and activated AKS feature. The problem I found was the aks master pages do not get applied if the feature is not activated on the top site collection. why is so?

example: If i activate the feature on http://<servername>/sites/<sitename> and apply the master page, I dont see any changes.

              But if i activate the same aks feature on http://<servername/ then everything started working on all sites.

              The reason i found is the CSS reference in the aks master pages.

              It reference should be given as follows:

                 for http://<servername>/sites/<sitename> ->  <link rel="stylesheet" type="text/css" href="../../Style%20Library/AKS/Aks_Band_Blueband.css"/>

                 for http://<servername>/ -><link rel="stylesheet" type="text/css" href="/Style%20Library/AKS/Aks_Band_Blueband.css"/>

So my question is, am i missing anything? am i supposed to activate the AKS feature on top level site collection at any cost? if yes, why is so? 

And after applying aks master pages, i see differnece in font sizes. Why the font size is getting changed?


Sharepoint 2007 - Wiki site - New Pages Not Inheriting Custom Master Page


I am working on a SP site (MOSS not WSS) which is heavily customised away from the OOTB layout. I need to create a Wiki site, which was going well - I've created a master page which displays the miniconsole (this was not visible with our customised layout), and made it the default master page for the site. This has been applied to the two standard pages that come with the Wiki site, however when a new page is created, it seems to inherit the default.master, rather than my custom master page - thus not showing the miniconsole.

When I have created a new page, I am able to use SharePoint Designer to attach my custom master page to it, which works perfectly, however this will not be a viable option going forward as end-users create their new wiki pages.

How can I get the new pages to inherit my master page when they are created?


Inherit from multiple master pages


How does one inherit from multiple master pages?


I.e.  I have a base master page that contains several ContentPlaceHolders.









I want to have separate master page files (one for each ContentPlaceHolder) so that I have 4 separate files: 3 ContentPlaceHolders (each adding specific content) and 1 base master page.

The ASPX files will then inherit from the base master page.



Programmatically Hide Master Pages from Site Master Page Settings page?



I know there is a field you can check when you edit the properties of a Master Page in the Master Page Gallery to set a Master Page to hidden but ... can anyone think of a way to programmatically hide specific Master Pages from the Site Master Page Settings page?

Maybe this should be two questions:

  1. How do I programmatically access a Master Page in a Master Page Gallery?
  2. Is there a property that can be set that will hide the page from the Site Master Page Settings page?

Deploying master pages in sharepoint 2007

Present situation:   Client has dev environment and they have customized the default page which comes ootb and is in Page Library. Also Created Master page using Sharepoint designer, and made that master page as the default master page for the site. The proposed solution: For promoting to different environments we will have to move packages WSP's across environments.   The present situation: All the environments were restored by using site collection backup and restore option (stsadm -o restore ...)   The Problem: Can we overwrite the master pages, page templates which are presently in master page gallery and page library by using feature   Or is there a better way of doing this.   Can somebody specify a better option for promoting.  

How to apply skin to master pages

i have master pages set to each page, i want to use skins, but i cannot attach it to master pagedo i need to go in every page and set theme there ?how can i apply it to master page, so that it gets applied to all the pages

master pages / connecting to databases / classes

I have a scenario where I pick up users and query them from active directory for a project, I've put the connection to database etc into the master page.cs for the meantime.Questions are:This is probably not the best place to put the connection query code, as it will do the query everytime the user goes to another page...correct?Would a better scenario be to pick the userDetails up on initial contact then carry the userDetails to each other page, can you use sessions to check if it is indeed that user? Thinking PHP here.Any thoughts would be appreciated!

master pages - how to access content page from master page?

Hello,I have a master page setup that is used throughout my site that is basically a header with a menu. I recently added a textbox and a button to this master page which is to be a quick search box that is available anywhere in the site. When a user enters text into the search box and hits the button, I need to load the actual content page which is used to search and show search results (which also uses this same master page), and have the text entered available so the search can be triggered automatically. Again, this search text box and button is now in my master page so it could be  triggered from anywhere in the app... it serves as a convenient way to do a basic search from anywhere in my app, without having to first navigate to the actual 'search page' that already exists.  You can also navigate to the actual search page, which uses the same master page, where there is many more search options.I'm thrown off by the master page arrangement, which I have not used until this project. What do I do?

Help !!! with VS2010 master pages

i'm developing a site using VS2010 and with my windows vista busniness OS. i used the default VS2010 wizard for new web application to create it. included a folder in the root directory and created new aspx pages to derive from the master page in the root directory of my site. everything shows on the new pages except the jpeg image logo in the master page. But other aspx pages i created in the root directory shows every thing fine.  Please please please !!! can anyone help me to solve this problem?  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend