Click here to Skip to main content
15,891,864 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 Updated

Masterpage 

31 Aug 2022 by Dhritirao's
how to create a master page for simple login application. can we maitain the master page for all the pages that application. please provide anu links.
24 Jun 2020 by atul sharma 5126
Hi All,I am using master page in my application having a child page where master has the menu.The problem started a few days back when I tried to mould some design in master page.Not the master page loads as fresh after child page load leading to removal of properties of child...
24 Jun 2020 by amir2965r
prevent post back master page when web form with master page open
5 Jan 2020 by Christian Graus
With CSS. You use CSS to control elements on a page
5 Jan 2020 by Maideen Abdul Kader
Hi I have an issue to fixed header in asp.net with Master Page Please advise me Thank you Maideen What I have tried:
26 Dec 2019 by Saam Abbas
You have to set the cookieSameSite= "None" in the session state tag to avoid this issue. I have tried this and working well. Please check the given below URL: Problem with Session in iFrame after recent...
31 Jul 2019 by Tarun Jaiswal
in ASP.NET master-page m usign bootstrap navigation bar. navigation bar have some links and dropdown named login menu, when i click on in dropdown login menu it works fine but as soon user click inside dropdwon login menu to to enter his username and passsword dropdown menu gets toogle.what i...
10 May 2019 by Manidas Payyoli
CS1061: 'System.Security.Principal.IIdentity' does not contain a definition for 'GetUserName' and no extension method 'GetUserName' accepting a first argument of type 'System.Security.Principal.IIdentity' could be found (are you missing a using directive or an assembly reference?)What I have...
10 May 2019 by hongz1
not sure whether you already figure this out, but to use 'GetUserName' method, you may need to include namespace of "Microsoft.AspNet.Identity" on your front-end page. VB.NET:
26 Feb 2019 by Hien Nguyen
Hi all, I am trying that following on : https://www.aspsnippets.com/Articles/Pass-value-from-child-popup-window-to-parent-page-window-using-JavaScript.aspx And it work fine. But when using parent page had master page. Javascrip error, can not get value. ...
8 Jan 2019 by Member 4257299
Hi, I am trying to add views to a multiview but I want to add views based on the session updated from a button click in the master page. But since the views need to be added in a content page page_init, and the master page button click is fired after the page init/control init, the view is...
18 Jul 2018 by byff
For reasons owing to the availability of software, I'm stuck working in Visual Studio 2010 (.NET 4.0). I'm developing a site using WebForms, and the prototype utilizes Master Pages, including the standard tabbed menus provided by the default Master Page. (May well abandon MP setup, but for now...
5 Jul 2018 by Herman<T>.Instance
Hi Folks, I am creating websites with same css layout, same masterpage (only app title changes) and the default.aspx. I would like to add these features to a Nuget package so I could reuse the stuff again and again in stead of copy waste.... Is is possible to use a Masterpage from a DLL in...
5 Jul 2018 by GKP1992
Sharing master pages is a bad idea, but if you're willing to go through the pain, Dan Wahlin - Sharing Master Pages Across IIS Applications[^]
7 May 2018 by Herman<T>.Instance
Issue is solved. It was a caching thing in the browser...
7 May 2018 by Herman<T>.Instance
Hi Folks, in my asp.net website I have signalR installed and when an exception is recorded in the Errors Table of my MS SQL Server the SqlDependency is run, the error is received from the db, the ErrorHub sends the message to all context.Clients.all.... My page shows a pnael with the message...
21 Apr 2018 by Varun Sareen
Hi, I have been struggling to get the right click disabled in the embed tag. I don't want the user to download the PDF from the embed tag. Please suggest me a solution. Regards Varun What I have tried: I tried disabling the context menu click on the page but it is working outside the...
29 Oct 2017 by Rajeshyadav12
Hi I am getting the following error: The TargetControlID of 'mpePopUpInformation' is not valid. A control with ID 'lnkName' could not be found. I have 2 .master pages, in site.master page i have written and in...
16 Oct 2017 by Ahmad Abd-Elghany
hello , i want to make a multilingual site with master page . when i use the InitializeCulture() method in the master page it alwyas get wrong.i have alot of oages nested from that master page , so how can i do that ?
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...
19 Jul 2017 by sam_matte
I created a masterpage named "site1" and inserted an updatepanel with a textbox and calendar. when I compile it, it gives error: The type name 'site1' does not exist in the type 'System.Web.UI.UpdatePanel' this is the following error: Line 179: } Line 180: Line 181: ...
5 Apr 2017 by RKeyy Sii
I have a MasterPage in ASP.NET that creates consistent layout for the pages of my application but there are some pages that are put in separate file so it doesn't have a MasterPage. I also have a separate file page WACHeader.ascx for header. So what I want to do is put a common header or the...
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....
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
6 Jan 2017 by Masoud__Sh
Hi all!i want to remove ctl00$ from button control NamingContainer when using masterpage.What I have tried:I tried to remove ctl00$ from server side button's name and id by overriding it's NamingContainer like:namespace NoName{ public class MatchingNameButton : Button ...
6 Jan 2017 by AnvilRanger
You can set the ClientIDMode.Control.ClientIDMode Property (System.Web.UI)[^]
5 Jan 2017 by JanardhanSharma
Im using 3 Iframes in the master page.iframe-1 referenced to TopMenu.aspxiframe-2 referenced to WelcomePage.aspxiframe-3 referenced to BottomMenu.aspxifram-1 and iframe-3 are constant here. Im trying to open the aspx web formsin Iframe-2 (i.e. in middle frame). But though the...
5 Jan 2017 by F-ES Sitecore
javascript - Change a parent window's URL using history pushState when link in Iframe is clicked - Stack Overflow[^]
29 Dec 2016 by JanardhanSharma
Im using 3 Iframes in the master page. iframe-1 referenced to TopMenu.aspxiframe-2 referenced to WelcomePage.aspxiframe-3 referenced to BottomMenu.aspxI had placed the Logout button (i.e ImgbtnLogOut) in TopMenu.aspx which is referenced to iframe-1onclcick of logout button,...
29 Dec 2016 by JanardhanSharma
I got the answer window.parent.location.href = 'Login.aspx' is making me to achieve it.. But is this the right way to achieve it?protected void ImgbtnLogOut_Click(object sender, ImageClickEventArgs e) { Session.RemoveAll(); Session.Abandon(); ...
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" ...
12 Sep 2016 by Vincent Maverick Durano
How about if you use the class name as the selector? For example:$(function () { $('.date').datepicker({ changeMonth: true, changeYear: true, yearRange: '1970:2012' }); });
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 [^]
21 Jul 2016 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.
6 Apr 2016 by DrgIonuţ
I have a project in VS 2013 with master page. In the Root.master I have the "Log In" which redirects me to the login page.When I login I'm redirected to a certain page, let's say it Default.aspx. In...
18 Mar 2016 by Chenna Gadicherla
In my MVC 4 Application Master page side header portion there is sign-in form, now i want to write a code for sign-in button in Master page side like normal code behind code.Any one have idea help me code.What I have tried:I'm trying to write code for sign-in form in Master page MVC 4...
18 Mar 2016 by F-ES Sitecore
Master pages are a technology from webforms, you don't have them in MVC. Even then your question is basically "how do I write a website". You can't learn something like this from asking questions on a "quick answers" forum, get a book on MVC and go through it, or at least go through some...
17 Mar 2016 by incobilgisayar
i wan to use an usercontrol (aspx) in a masterpage (in content pages) bu i can't. is there any sample to explain how to solve my problem.What I have tried:usercontrol (aspx) in a masterpage (in content pages)
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.
6 Dec 2015 by Member 11656452
Hello,I am working on ASP.Net website with Visual Basic as backend language. I am working on Master-Child webpages. I have created a Public string property on Master page and want to permanently change its value. When I change value of property it is updated properly, but when I move to some...
19 Aug 2015 by Sergey Alexandrovich Kryukov
Just don't show the restricted content to an unauthorized user. What's the problem?Remember that any user can request any page. It's up to you what to show on this page. The whole purpose of ASP.NET and any other server-side technology is to generate HTML pages and any other resources...
19 Aug 2015 by Kiran2401
Hi, I am trying to build an web application in which, 1. Contains Master page and internal pages (Content pages to Master page).2.When application is started, user is taken to Login.aspx page (which is not a content page of Master page.)3. Once user is valid (authenticated), he will be...
8 Aug 2015 by Member 11011853
Hello...im trying to bind data from sqlserver database to dropdownlist placed in content/child page using jquery. I referred many articles, they specified only for plain webform, not to content pages.Its working fine in plain webform, and not in child pages...! my code is :
6 May 2015 by Member 10235967
I am using Master,content page concept.In master page two menus top,side menus are there.I wrote logic in Masterpage load event to bind Modules data dynamically to top menu.the side menu data will be binding dynamically when click on top menu item(binding pages data of respective module) When...
1 May 2015 by Sergey Alexandrovich Kryukov
There is no such concept as "call a tag". With JavaScript, you can change the body background by changing its style at any time. For example:document.body.style.background = "#faa85b url('background.png')";—SA
1 May 2015 by Samira Radwan
Hi Experts,I have a master page with body tag looks like this:I need to change the body background image according to user choice from dropdownlist.So I called master page body tag in content page code behind (dropdownlist selectedIndexChanged)...
8 Feb 2015 by Shridhar Gowda
IN web.config file, add thissystem.web> ...
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[^]
8 Feb 2015 by Badour alsamaraie
hi everybody ,,i want to ask about using master page. i am work on archiving web application so i lad web application with master page contains rooted menu to different pages. i want to force log in before accessing any page in the application
13 Jan 2015 by Member 10809057
How to make master page caching in asp.net and whether is it good way to cache master page.
13 Dec 2014 by DamithSL
change '#'to '#'also check below tip for alternative approach of finding control on master page from content pages Finding Controls in a Master Page with jQuery[^]
13 Dec 2014 by Member 10037752
i've a "SearchText" Textbox in master page. I used the Script code for search suggestionmy code is $(document).ready(function () { $('#').autocomplete({ source: function (request,...
3 Dec 2014 by ZurdoDev
This is because it is under the App directory, not the root. Using ~ means the root of the site. So, if you changed the App folder to a directory in IIS it would fix this issue.
3 Dec 2014 by yallakorra
i Have A master Page in Directory Of Application ( App/Masterpage.master )i am Using This Master Page In Many pages and no problem in Visual Studio WHen i Published My Application On IIS its can't found it For Eg:-
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(); ...
15 Nov 2014 by Dhaneshmon
I have a Master page that contains save button and cancel button. It should be executed the code which I am writing in the content page( In all my content page, i am planning to inherit an interface which is having Save() and Cancel() methods, so Save and Cancel method will be there in all...
22 Oct 2014 by Kornfeld Eliyahu Peter
ASP.NET does not support multiple form tags with runat="server" - http://msdn.microsoft.com/en-us/magazine/cc163736.aspx#S4[^]...But, because HTML does support multiple form tags you can have them also in ASP.NET, but only one of them can have runat="server" and for that only one of them will...
22 Oct 2014 by Torakami
Hii , My scenario is like i have login view control on my top of the page which requires form tage with runat=server tag , i also need to form tag with runat=server tag for content place holder so that it will be for all child pages , Between this there are few search boxes which...
21 Oct 2014 by Luis Oliveira 1966
I've made a change replacing ResolveUrl by Page.ResolveClientUrl on master page and it seems to be working fine now. But I really have no idea about why...
20 Oct 2014 by Luis Oliveira 1966
I've this:'>When navigate to a page that call some script function, a runtime error message says: 0x800A01B6 - JavaScript Runtime Error : The Object : does not support property or...
7 Oct 2014 by Sinisa Hajnal
If you don't want responsive design, set the fixed width of the body element (or outermost container you want to have fixed:CSS: .outermost {width: 980px !important;} /* put any width you fancy here */Note that this will indeed be fixed so that if your browser window goes under that...
7 Oct 2014 by Rahul Sarkar
Hello,PFA the sample Master page which I am using in my aspx website.When I resize the Browser window, all Items of my website gets reshuffled. Like Menu Bar,...
5 Oct 2014 by Sinisa Hajnal
Either have both of your master pages inherit the same base page class which handles the session (OOP) or copy session handling code in both (bad practice)The fact that the page has different master makes no difference to the session.
5 Oct 2014 by Jack_1991
Hello, I need to maintain session in one aspx page. But the master page of this page and master page of entire site is different. So how manage session in this scenario, if user make some server side activity in that page or even in any page of entire application then session alert timeout...
28 Sep 2014 by Leena 206
I have one Login page which is created using Master page. Now I dont want this page in master page, How can I achieve it?Is it only way to delete content(tag content - and
25 Sep 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Safer solution would be...1. Create a new aspx Page.2. Copy all the contents or controls inside the Content Place Holders in the old page correctly into the new aspx page.That's it !!!
9 Sep 2014 by Sinisa Hajnal
Instead of accessing the control from previous page you should store the selection in session variable or URL and read it again on the new page.Also, you should never use the object without checking for its existence and validity: RadioButtonList rblOperation =...
9 Sep 2014 by Abdallah Al-Dalleh
Hello allIn my asp.net application I use one master page for all pages. In some page I want to get a control from the previous page and get a value from it, I did it using this: rblOperation.SelectedIndex =...
4 Sep 2014 by Sinisa Hajnal
Everytime you refresh the child, whole page loads, master page is simply part that makes the design easier. Master page isn't a page with iframe that loads separately. You can simulate it by having UpdatePanel, but by default, loading master page is expected behavior. Add If not ispostback to...
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...
18 Aug 2014 by Muhammad Taqi Hassan Bukhari
I am working on my fyp, developing a website in asp.net 4.5 using visual studio 2013.I have a master page, and a webpage that extends that master page. 2 days ago, it was working well but now it gives error. that master page can not be load.Parser ErrorDescription: An error occurred...
4 Aug 2014 by Member 10992019
Hi there everyone, I have a small problem,Im creating a web app that uses master pages. the application has a set of pages that clients can access and they inherit from a Site.master. It also has a set of pages that employees can access which in turn inherit from Admin.master.I have...
2 Aug 2014 by kozmikadam
I solved the problem.My button is in table , which one is a asp net control. So i use html table. And button is work now.
2 Aug 2014 by kozmikadam
Hi everyone ,I'm using masterpage. And i added a default.aspx using masterpage. After i added a button in to this page.My aspx page :My aspx.cs page...
2 Aug 2014 by Matthew Dennis
In order for ASP.NET controls to work, they need to be in a Form which posts back to the page.
26 Jul 2014 by Vaishali-Member 3830703
Add on master pagebelow script $(function () { // Setup drop down menu $('.dropdown-toggle').dropdown(); // Fix input element click problem $('.dropdown input, .dropdown label').click(function...
13 Jul 2014 by ArunRajendra
I guess you are adding the script with respect to Master page location. If so change it to always point from the root by using ~.Lets take this is your folder structure-> Master PageFrom root the script file a.js will be referred as /script/a.js....
13 Jul 2014 by Amit Kumar143
Hello All,I have a dialog in the master HTML and I'm hiding it and showing it based on a button, which is also in the master HTML. Everything hides/shows fine in root pages but not on pages in subfolders. When these are displayed the dialog HTML code is never hidden and the button click...
14 Jun 2014 by Debabrata_Das
Hello friend, you can use Ajax UpdatePanel control in Master Page to refresh the content page only. Try the following code:MasterPage.aspx:Master Page
14 Jun 2014 by Nirav Prabtani
try to use iframe instead masterpage.. :)Check out this example .iframrStyle { height: 1000px; width: 100%; border: none; ...
14 Jun 2014 by Member 10202727
I am trying to redirect to different content page through my master page but i don't want to refresh my master page.As our master page is nothing but an content page only but i don't want to refresh master page content.Ant technology in asp.net so that i can achieve it.Thanks
28 May 2014 by rogerfederer670
By putting the DataBind of masterPage's load function in the condition of not being postBacked,the problem got solved.Like this:protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { fillPage(); this.DataBind(); ...
27 May 2014 by rogerfederer670
Hi everybody.I had a problem with my masterPage and content page for that.First of all,there is a masterPage in my asp.net project,that has a box for dynamic display ofnews and because of this dynamicity, i have BindData for masterPage in Load event function.Like below:protected void...
25 Apr 2014 by Murugesan22
you can place two ways to access javascript fileIn master page In Content Page
25 Apr 2014 by AnvilRanger
When you create you create the registration form and associate it with the master page it will have a Content control for the header. Just place the script tag for you registration js there.
25 Apr 2014 by M.Thiyagaraja
Dear Sir..My .aspx page having Master page in itQuote:
15 Apr 2014 by Member 10750692
I have a JQuery Range Slider in Master Page with 3 possible options like OPT1,OPT2,OPT3 and based on the selection of any among the three available options it should be redirected to three possible .asp pages.I did that using Windows.Location("..\opt1redirectpage.aspx").But the problem is when...
3 Apr 2014 by Member 10167580
Add this after your system.web tag that contains the deny users="?":
29 Mar 2014 by Peter Leow
Refer: Calling JavaScript from ASP.NET Master Page and Content Pages[^]
29 Mar 2014 by pwavell
i m using the following function to return value from current page to another page.this works fine if i use both simple pages without master page.But when i use content pages with master pages its not returning value.the value that i get is "undefined".function SelectAndClose() { txtValue...
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.
26 Mar 2014 by Raul Iloc
You could do this by implementing you own a site map provide class (that extend StaticSiteMapProvider) and based on the user roles to add or not links nodes to you master page. The building of your master page links node based on the user roles have to be done by overriding the method...
26 Mar 2014 by Nirav Chheda
Hii..I am stuck in one scenario where there are multiple master pages. Here's my question :- My Website uses Asp.Net default membership provider. I have 3 users and 3 roles.I have a page called as "RaiseTicket.aspx" this page is accessed by users of all roles. The design of master...
22 Mar 2014 by Nirav Prabtani
Just enter userID in to session during login like this.. :)Session["user"]= 5;You can got it Any where in application till it will not expired likelblSession.Text=Session["user"].toString();Set session timeout like this ...
22 Mar 2014 by ZurdoDev
You just need to set the session variable. However you are logging them in set Session["client_username"] = someVariable; Then you can use it wherever you need it.
22 Mar 2014 by Neeraj_kaushik
Hello Developers,I want to know on my website Home page, which user is login in his account. If anyone will be login, then his Username will be displayed on my website home page in his system. and if no one is login, then "Welcome Guest" will be displayed.Please give me solution for...
12 Mar 2014 by Ajith K Gatty
You can specify master page details in the required child page. Here portpolio.aspx is child web form.