Click here to Skip to main content
15,886,083 members
Everything / Masterpage

Masterpage

Masterpage

Great Reads

by NightWizzard
...for example a WYSIWYG HTML editor to edit or display emails...
by nibeesh
To get an element by its ID in a webpage which uses a master page
by thatraja
DescriptionY...
by Joyce Keller 2
Using MasterPage.master for ASPX pages, in Visual Studio 2008 and 2010, an ASP content area is automatically created for use within the head section of the HTML code when you create a new page using a master page.If you aren't using Visual Studio, you can create a content area for the head...

Latest Articles

by Vincent Maverick Durano
A quick demo on how to pass values from a modal-grid WebUserControl to main page based on the selected row in GridView.
by William Emmanual
Planning the Master Page in ASP.NET
by NightWizzard
...for example a WYSIWYG HTML editor to edit or display emails...
by Joyce Keller 2
Using MasterPage.master for ASPX pages, in Visual Studio 2008 and 2010, an ASP content area is automatically created for use within the head section of the HTML code when you create a new page using a master page.If you aren't using Visual Studio, you can create a content area for the head...

All Articles

Sort by Score

Masterpage 

12 Apr 2013 by NightWizzard
...for example a WYSIWYG HTML editor to edit or display emails...
8 Jun 2011 by Wonde Tadesse
Yes, there is a way to do that. But I wonder why you need two master pages. Isn't one enough for you ? If you create to change the look and feel, It is better to play with CSS, Not master page.Anyways, Here is the solution.Instead of putting code in each page PreInit() event, Put the same...
22 Feb 2012 by Bun Leap_kh
All directories or files in the same directory with this Web.config file could not be accessed if not login. So to access common files such as Master Pages, Stylesheet files, images, you should store those in separated directories and all those directories must have their own Web.config file...
17 Nov 2010 by Keith Barrow
In the master page you can do this: Then in the aspx:
31 Mar 2011 by cjb110
To get the filter to apply, I added the following to the LinqDataSource:Where the ControlID is the id of the control on the master page.This filters after a post back...which is a bit ugly, so...
26 May 2011 by nibeesh
To get an element by its ID in a webpage which uses a master page
27 May 2011 by thatraja
DescriptionY...
8 Jun 2011 by virang_21
Hi, I have a web application with 2 master pages in it. My client wants to change look of the web application each month. For that purpose I created 2 more master pages with different look and feel. The problem I am facing is changing master pages dynamically. One option I have is to...
9 Sep 2011 by Karan_TN
hi,currently i m using asp.net with C# 3.5.i m using master page.here i need to capture the browser local time and want to store in session variable in page load. i m using following javascript code function...
22 Feb 2012 by janwel
Hello fellow programmers got a few error here. I am managing my web.config to set authorization and authentication. My problem is when I run my project, My master page's design is not working but when I logged on it returns to its original design. Is there any conflict between master page and...
8 May 2012 by danait25
Hi, I'm using telerik rad tabstrip & VB.net on asp.net forms with master pages. I used this article to create auto save the data the user insert : Easy Automatically Save Form with .NET and AJAX[^]my problem is, that it saves the data only for the first time.after that, I...
2 Aug 2012 by R. Giskard Reventlov
Start here[^].Or you could learn how to do it for yourself (not that I'm all that good at the artistic side of web design, preferring to leave that to someone whose level of artistic skill is a touch better than badly drawn stick men).
4 Aug 2012 by Christian Graus
The error means what it says. What makes you believe this method exists on the base class ? The compiler is telling you it does not. I checked the documentation, the compiler is right. This is not how you do locale in a web page.I found this[^] with google. I think your core idea is OK,...
25 Oct 2012 by Sergey Alexandrovich Kryukov
It simply mean $get("Accordion1") is null (not an object). If this is jQuery, the syntax is wrong, could be: jQuery.get, $.get or $.ajax. Please see:http://api.jquery.com/jQuery.get/[^].If this is something else, I'm not sure. You did not tag jQuery, so it can by nearly anything. For...
25 Oct 2012 by AshishChaudha
Please check the ID of the Accordin from View source.Thanks
26 Oct 2012 by Santossh
Try to use $get("")instead of $get("Accordion1")Let me know if it doesn't work.
6 Dec 2012 by Surendra0x2
Refer This Link-http://www.dotnetfunda.com/articles/article1500-how-to-change-the-master-page-dynamically-for-a-content-page-in-aspnet.aspx[^]
21 Dec 2012 by Dhritirao's
i created a master page and added menu and after that i also added site navigation path how edit that i m not getting the path as per my application how change the settigs for that.
14 Jan 2013 by Dhritirao's
i have created a master page for login of a employee for his company site.and i wrote the code for login button in the same source page in script. but for this line ClientScript.RegisterStartupScript(Page.GetType(), "validation", "alert('Invalid Username and...
14 Jan 2013 by Sergey Alexandrovich Kryukov
I am not really sure if should proceed from there. If your master page has login form on it, it means that all related content pages will also do the login. In principle, this is possible — it might look like in CodeProject. But are you sure you need it?Anyway, please see this tutorial:...
14 Jan 2013 by Dhritirao's
in master page if we click on login button then i m not getting any code behind page seperately it is showing source page do we need to write the code in this page only but how to add the sql conncetion those all things.
22 Feb 2013 by Shubh Agrahari
Hii professional...this is some important link that can help...
26 Feb 2013 by Shelby Robertson
Include the CSS file you want to use in the content page instead of the master page.
26 Mar 2013 by satz_770
You can do it in JQuery.. $("a.shortcut-dashboard").on("click",function(){ if(!$("a.shortcut-dashboard").parent().hasClass("current")) $("a.shortcut-dashboard").parent().addClass("current");});write this inside $(document).ready(function () {if this doesn't solve, reply...
4 Apr 2013 by bbirajdar
A little google search would have saved your timeMaster Pages using HTML and JavaScript[^]
21 Jul 2013 by Dholakiya Ankit
HyperLink hl = (HyperLink)this.Master.FindControl("linkviewmysite");session["user_name"] = ds.Tables[0].Rows[0]["username"].ToString(); Response.Redirect("Siteadmindata.aspx", false);now in master page page...
23 Nov 2013 by aravindnass
heyy... I have 3 themes in my App_themes . The theme will set or call in my masterpage(source code) . I want to set a value in web config file ie.. based on...
5 Feb 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
You can create one Web UserControl for body part. Include that in the Page.
26 Mar 2014 by ravikhoda
u can follow the below link ...[^]on the navigation panel give runat="server" attribute and on content page find control by master page and then you can access the control and can hide it.
18 Aug 2014 by Snesh Prajapati
There may be namespace/class name conflict as Users may be a class created by Entity Framework too (if pluralization is allowed). Change the name "Users" to "UsersPage" for UI code and Let me know the outcome or error after that. Please look into following links those may help:Parser...
15 Nov 2014 by Michael Ulmann
In your master page click event for the button you can cast the Page property to the interface and then call Save on that.protected void myButton_Click(object sender, EventArgs e) { ICanSave myPage = this.Page as ICanSave; myPage.Save(); ...
8 Feb 2015 by nagendrathecoder
Follow these links:https://msdn.microsoft.com/en-us/library/vstudio/ehszf8ax(v=vs.100).aspx[^]Beginner's Tutorial on Master Pages in ASP.NET[^]
17 Mar 2016 by AnvilRanger
What issues are you facing? I can just Register the UC like normal and add the tag in the code for the master page.
9 Aug 2016 by Karthik_Mahalingam
Posting as Solution From RyanDev Commentsuse HttpContext.Current.User.Identity.Name to get the UserName and Enable the Windows Authentication [^]
13 Sep 2016 by koklimabc
in client side (markup view): , it rerquires to repainted each time after Prerendered stage, (simply do it on active form , not master form )function pageLoad(){ $(function(){ $("#").datepicker({ dateFormat:"dd/MM/yyyy" ...
5 Apr 2017 by Karthik_Mahalingam
just add the UserControl soon after the body tag in the pages where master page reference is not added, it will act like common header
5 Apr 2017 by Bryian Tan
Simple adding the MasterPageFile reference will not work, did you also move the content into a ContentPlaceHolder? Here what I would suggest, open a file XYZ.aspx that is currently using the master page, then compare it with TestLogin page. Modify the TestLogin page structure to match XYZ.aspx....
19 Jul 2017 by Sheila Pontes
Hi, How you didn't post the code and i could not create the error. I will write all the elements necessary for you create a master page. Your master page 1 - Scriptmanager component is obrigatory. 2 - Updatepanel...
27 Sep 2013 by itsureshuk
Good Morning Frnds, I have ASPX web pages with master pages.Entire Master Page and contentplaceholder given with form tag(runat="server")...But sub page button is not occuring.When right click on master page design and select view code its not going to C# code page.Master...
21 Jul 2010 by sargamlucy
Hi All,I have got a master page(Project>>MasterPages>>MainPage.master) and some images in that page with some path like "../../Images/bg_main_menu.png".I refer this master page in two forms. One of those form is oresent in the path : Project>>Forms>>Form1.aspx and the other one is :...
21 Jul 2010 by Sandeep Mewara
There is something like ResolveUrl. It should help you out.Read about it here[^].A good Tip related to it is posted here[^]. You should use it.sargamlucy wrote:"~Images/bg_main_menu.png". You are missing a forward slash after TILDA (~), before Images.~/Images/....
21 Jul 2010 by E.F. Nijboer
There is some info on msdn about the same issue:http://msdn.microsoft.com/en-us/library/ms178116.aspx[^]Maybe it's just as simple by adding the extra /"~/Images/bg_main_menu.png"Good luck!
23 Jul 2010 by sargamlucy
ResolveUrl dint work properly, but searching for that, i got one more thing called ResolveClientUrl.The difference between these two is... ResolveUrl can be used for ASP controls and ResolveClientUrl can be used for html controls.But now I have one more problem. This technique is not...
7 Sep 2010 by VeeReid
Hi,I have been struggling with this for a while now, so was hoping someone might be able to help me out. I have basically copied the source of this page: http://jqueryui.com/demos/dialog/#modal-form into two different aspx pages, one standard one, and one that uses a masterpage. The...
7 Sep 2010 by Abhishek Sur
use Return false from the click handler to ensure that the button never generates the Postback.I would also recommend you to avoid using runat=server if you want your button to never postback.
7 Sep 2010 by AspDotNetDev
Seems the default behavior for the "button" tag differs between browsers. Maybe the HTML is slightly different (e.g., whitespace before the HTML tag) so you are getting compatibility mode in IE in some cases. Read about this possiblity here: http://www.w3schools.com/tags/tag_button.asp I...
7 Sep 2010 by VeeReid
Thanks for this. I gave it a try, but no luck... the input button does nothing at all, doesn't even run the jquery code. To be honest though, I want the button to have a postback, but for the jquery to call it once the button in the modal popup is clicked - looking at the documentation this is...
4 Oct 2010 by tanweer
Hi allI a generating some aspx (web content page) in my application. My master page is at the Application root but those content pages are creating in the Directory "root/pages/page1/". Now I have to set the master page to these content page. In this way I tried to set the master page and...
4 Oct 2010 by #realJSOP
Look at this link and read the ENTIRE article.http://www.asp.net/master-pages/tutorials/specifying-the-master-page-programmatically-vb[^]
17 Nov 2010 by Patrick Skelton
Hi,I am certain this question must have been asked before, but I cannot find out how to overcome what appears to be an obvious problem when using master pages in ASP.NET 4.Since the master page contains the section of the document, it also contains the title and meta data (e.g....
7 Dec 2010 by m@dhu
Remove the below from your aspx page as you are using master page.
2 Jan 2011 by tamash_ionut
Hello everybody,I have a custom control (a shopping cart control) on a master page from which inherit some pages. The control has a total price and number of items information as labels that should be, of course, up to date . My question is : on each of the pages that inherited from my...
2 Jan 2011 by Espen Harlinn
It's a new instance for each page, so yes you can get away with updating it during Page_Load for the codebehind for the master page, or by binding.(Assuming that you are not using UpdatePanels or any other ajax related technologies)RegardsEspen Harlinn
2 Feb 2011 by nima_pw
Hi all,I created a masterpage in visual studio 2008.In my page I have javascript codes as below:
2 Feb 2011 by Steve Wellens
It should work. Start with something simple:
29 Mar 2011 by #realJSOP
Try this:ControlType control = (ControlType)Master.FindControl("controlID");And then you should be able to get the selected index.
12 May 2011 by Sri9797
I have a .net 3.5 website in which I'm having several .aspx pages using a single master page. I'm facing an issue every time the pages are redirected.I have a header in the master page where the title of website is displayed as image.beneath that I have a content placeholder where all...
12 May 2011 by Keith Barrow
If you mean you only want one part of the page updated (instead of the whole thing) you will need to use AJAX to provide partial page rendering. This[^] is a microsoft tutorial on how to achieve it.
26 May 2011 by demouser743
I use the script from the followinghttp://keith-wood.name/datepick.html[^]But he has displayed only 10-20 years at a time but i need to display the years from 1900 to present i tried by changing but it does not work so can any one solve this or any alternative for this
26 May 2011 by Kythen
Did you try looking at the documentation for the plugin? http://keith-wood.name/datepickRef.html[^]The yearRange setting looks to be what you need.
17 Jun 2011 by Vijay Radia
Change Function to following code.. you have extra "(" placed in if condition. function Check() { if (document.getElementById('ContentPlaceHolder2_txtName').value.length==0) { document.getElementById("ContentPlaceHolder2_txtName").focus(); ...
17 Jun 2011 by thatraja
OP wrote:Restarted the system and it worked. Lol !!! Dint change a line of code.I don't think your problem has been solved completely.Check for errors in firefox error consoleOP wrote:document.getElementById("ContentPlaceHolder2_txtName").focus();Don't use that ugly way(hardcode thing),...
11 Jul 2011 by nima_pw
My problem solved.In the following code:
13 Jul 2011 by Learning_abc
I have a Silverlight Parent Page which is like a master page. the child page derives from the parent page. This works fine. But if i want to add additional controls on the child page it is not possible. How can i achieve this functionality in Silverlight? Can anybody suggest some good workaround...
19 Jul 2011 by kmh72756
I've got a strange problem while developing a website using Nested Master Pages with ASP.Net under VS 2008.I designed each Master Page in sequence starting from the lowest level.In the order I completed them, each Master Page references the page just done.The design grows from one to...
25 Jul 2011 by Reshma89
Hello i want to put a background image in my master page that can be reflected in my default pages but this is possible only in vs 2005 but not in vs 2008 how it can be donei put a background image in master page that can be displayed both in master and default page but when i run that default...
26 Jul 2011 by Reshma89
yes i gave a correct path after that it can be displayed which property of the master page i can change(DiV,body,Form )
1 Aug 2011 by thatraja
Check properties like overflow: none; or overflow: hidden; (for body) in your style section or style sheet. If it there, then remove that or change into overflow:auto; or overflow:scroll;Also check scrolling="no" in your HTML, if it there then change the value to auto.
9 Aug 2011 by Djamanet
HiI have a master page from which i derive all the pages. On the master page i have a label called userLoginName (by default the text is blank.)From the login page , on the click event of the login button i have this code: Dim _logName = Trim(LoginName.Text) Dim...
9 Aug 2011 by Christian Graus
There's all sorts of issues with this code. However, at the core, the way I always do this, is to create a base page class for all my pages. In that base class, I expose a property which is the Master property of the page, cast to the type of the MasterPage class I am using. Having done that,...
17 Aug 2011 by liz9677
HiI'm new to posting on this site, but have found it quite useful for finding information. I have a problem however, and am not able to find a solution anywhere. i have a masterpage with a navigation menu. The menu items open different pages, and i am able to highlight the selected menu...
17 Aug 2011 by liz9677
I think i solved my own problem. Without sessions and the lot. Was quite easy in the end, but thanx for your reply. In MasterPage Load, loop through menu items and do some checks. Since the page being loaded accesses the masterpage, you just need to set the specific menuitems selected...
18 Aug 2011 by patelKhyati
i have two master pagesone is for all the site users(main.master) andother is for admin(admin.master)now my problem is, i want to change the text of a label in main.master from admin's home page.I have used the following code on button...
9 Sep 2011 by BobJanova
You either need to send it via an AJAX postback, or set it in a cookie and read that out in the next page request, or do all the processing with it client side, or have the user set their home time zone in a profile and calculate it on the server side.The easiest way is to set a cookie (with...
9 Sep 2011 by Robin Rizvi
Add runat='server' attribute to the control whose value you are setting in the javascript code above.I hope I was able to solve your problemWatch my first article posted on codeproject and comment and vote:http://www.codeproject.com/KB/HTML/speechinputapi.aspxor...
18 Sep 2011 by kriinfra
when i run my website and my master page loads,at that instance i want to search in my solution for pagedefault.aspx and take snapshot of that page and convert that into an image file and save it to a particular location. all this should happen at runtime when my master page gets loaded.
18 Sep 2011 by Ganesan Senthilvel
You can over ride Page.LoadComplete event to take snap shot using s/w like drivesnapshot and store it to a particular location. Key event is:
18 Sep 2011 by Anuja Pawar Indore
refer this thread, hope it helpshttp://stackoverflow.com/questions/2715385/convert-webpage-to-image-from-asp-net[^]
23 Sep 2011 by Dinesh Ambaliya
Where I can set focus and set the default button in .aspx page when using master page?
23 Sep 2011 by E.F. Nijboer
You can set the defaultbutton property. Check the link for more info:http://weblogs.asp.net/scottgu/archive/2005/08/04/421647.aspx[^]Good luck!
26 Sep 2011 by sasolanki007
Use prism for this. that will definitely help you with this.Prism[^]-Sagar Solanki
12 Nov 2011 by Sasmi_Office
Dear Friend'sI am facing one issue the scenario is as given below.I have created an application which is has a master page, multiple pages map to that master page.The master page has a menu control which is populated using data coming from Execute Procedure.The menu map has child...
12 Nov 2011 by thatraja
Use techniques like CacheExploring Caching in ASP.NET[^]
6 Dec 2011 by Far sh
actually I'm developing a template using ASP.net and C#.my template include 3 part and i want to have partial refreshing, that's why i'm using updatepanel.in this template once the user click at the top menu it will refresh the side menu then when the user click on the side menu it will...
11 Dec 2011 by Far sh
i have solved this problem using User Control method.now i have put content of the page inside uc1 and used the below code to call the page at the update panel:once the user click on the related button i...
17 Dec 2011 by emyfawzy
I'm not professional. my website is in asp.netI was editing the data of my website through an admin page using username and password. unfortunately i had lost the username (deleted it by mastake from the admin page) and now I can't access the admin page and can't edit the data of the website....
17 Dec 2011 by thatraja
AFAIK only two options.1. Using other login(admin), just create an another admin User ID(if possible)2. Or enter values directly in database(for the admin login)
18 Dec 2011 by Anuj Banka
If you have any page where you can create new user then create new user as admin.Other wise you have to contact to your admin for entering the admin from the backend.
29 Dec 2011 by Mohankumar.Engain
Dear sir,when I login Admin side, my master page" menu's" is not displaying?other login - menu is properly displaying.what can I do?Any modification in my master page or what is the error How to solve this problemplease tell meBy mohan.
29 Dec 2011 by Manish.Insan
I think you have set visibility false of the menu. and conditionally you are showing like for user it is showing in this way or this one and for admin you have little bit modification and set again visible to true. then it'll show otherwise paste some code for clear help.
4 Jan 2012 by iampratik
I am trying to disable a linkbutton in side data repeater in masterpage from another page. I am trying to create list of pages in masterpage, when one of the link is clicked, it redirects user to that page. So, when the user in the page, its respective link should be disabled, which is in master...
4 Jan 2012 by K C Behera
Write following in click event of LinkButtonLinkButton.Enabled=false;
17 Jan 2012 by Sergey Alexandrovich Kryukov
CSS has nothing to do with JavaScript and cannot disrupt JavaScript execution in principle, but JavaScript can modify the styles.So, I can have only one guess. If you really did not modify any scripts, they should still execute the way they did before, but the effect of them could be made...
23 Jan 2012 by manikandanid
Hi,I have added a client function to update a hidden variable in master page onbeforeunload event. I am getting the value being alerted but after post back when i explore the request.form or directly the hidden variable i am not able to find the value.Should we not update the hidden...
29 Feb 2012 by MiguelSanchezCuarental
Hi everyone!!I have a problem. I want to ignore or disable the validation of a form when I click in a button of the master page.I have in the master page a button in the header, to logout from the web and I have a few of forms with the master page. I have in these forms a validation...
29 Feb 2012 by Mario Majčica
Why don't you just set on the button that should not do the validation followingCheers
1 Mar 2012 by Rachana Patel
I have written my javascript in Master Page.I have two aspx pages. One aspx page as main page, and another as popup window.I am calling itthe popupwindow from Main page. In javascript I am extending session when it timeout. It's working fine for Main page, but not working for popup window...
1 Mar 2012 by R. Giskard Reventlov
I think this may be sort of what you need: adapt as required:// Used to track a popup window: only allows one version to open at a time.var popup;// The window attributes: this does not work correctly in IE6: who cares? :-)var attr =...
16 Mar 2012 by yl2rox
I have included two Dropdown-lists inside an UpdatePanel. First Dropdown-list contains a list of Departments. What I want to do is, when the user selects a department, the second Dropdown-list should be populated with the list of employees work in that particular department.I have used an...
16 Mar 2012 by Prabhakaran Soundarapandian
Add the below code inside your update panel