master-pages

Propagting the resource culture change in master page to the content web pages

感情迁移 提交于 2019-12-11 11:05:29
问题 I'm a noob when it comes to web applications. But i'm trying my best to learn it using ASP.NET 2.0 and sorry for the long post. I have a master page(M1) and 3 different content pagesC1,C2,C3 which basically use the master page M1 for filling its respective contents in the content placeholder. All the web-forms are localized and appropriate language resource strings are added in the resource (xml) files ex: Resource.en-US.xml,Resource.de-DE.xml and so on.Finally the resources are referred in

Can we avoid few of the CSS files which are there in master page to load in the content pages?

送分小仙女□ 提交于 2019-12-11 08:43:27
问题 Basically what i want to say is can we decide among the list of css files defined in master page which one to load in content pages. Generally whatever CSS and JS files we define in master pages we can see their behavior in content pages can we control this behavior 回答1: You can run through your registered links like this: var links=this.Header.Controls.OfType<HtmlLink>(); typically, you can do that in the oninit of your page. Then you can add/remove/modify registered css or javascript. 回答2:

Strongly typed master pages polymorphism - nested masterpages ignore inherit attribute

☆樱花仙子☆ 提交于 2019-12-11 07:47:54
问题 I'm currently creating a CMS system and found that the following doesn't work. I do have a work around that isn't exactly ideal and feels dirty. I'm cool with it for now and not really that interested in a different approach (but don't let that stop you answering). What I am after is some kind of explaination on why it doesn't work - is it a bug in ASP.NET MVC? It's hard to explain so I'll let my code (minus alot of fluff) do the talking... hope it makes sense! EDIT: It seems that the

can I get php to run in an asp.net page?

我的未来我决定 提交于 2019-12-11 07:45:59
问题 I'm trying to allow my php pages to run inside a content page of the master page. I'd like to run php somehow inside a master page. Besides frames is there another way? I've read you can use a frame, but would prefer not to. If I have to go with frames to get it done, should I be using an asp.net frame class of some sort or the raw html type? 回答1: Well, there's always Phalanger for running PHP within the .NET framework, but I recommend against mixing environments like that. If your PHP pages

catch close browser with onunload function using master page in ASP.NET

放肆的年华 提交于 2019-12-11 07:33:55
问题 I have a website with master page. I want to catch a user trying to close the browser/tab. When I try using onunload in the body tag, it fires not only when I try closing the browser, but also when I navigate to another page. Any idea how to only catch the event of closing the browser? 回答1: You can't distinguish closing the browser from navigating to another page. In both cases the current page is unloaded. update: maybe you can handle some cases with some jquery, i.e. whenever a link is

Load different master pages for different users

三世轮回 提交于 2019-12-11 07:16:32
问题 In my Web-project (ASP.NET) I need 2 different master pages. One for users like "Admin", and one for the usual users. Where can I indicate what master page to load? How can I load the correct master page, depending on the user? 回答1: When your admin user try to log in check the username and password with the database and if the login credentials are valid, Set a session variable to indicate this is an admin session. Then you can have a method which returns true of false by checking the session

JQuery in ASP.Net Web form with a master page

老子叫甜甜 提交于 2019-12-11 06:57:46
问题 I have a page named CoursesPage.aspx and it has a Master Page. In CoursesPage.aspx I'm using the autocomplete jquery on the course name for better searching. This is my script code: <link rel="stylesheet" href="css/jquery-ui.css" /> <script src="js/jquery-1.8.3.js" type="text/javascript" language="javascript"></script> <script src="js/jquery-ui.js" type="text/javascript" language="javascript"></script> <script type="text/javascript" language="javascript"> function LoadList() { var ds = null;

ASP.NET: Passing data from content page to master page [duplicate]

南楼画角 提交于 2019-12-11 06:45:36
问题 This question already has answers here : How to control elements on a asp.net master page from child page (5 answers) Closed 5 years ago . I have a label named headerLabel in my master page, and I'd like to set its text to the title from the content page. How do I do this? 回答1: On your master page create a public property - something along the lines of: public string LabelValue { get{ return this.headerLabel.Text;} set{ this.headerLabel.Text = value;} } Then, on your child page you can do

FormView on a Master Page can't see databound controls through ContentPlaceHolder boundary

╄→尐↘猪︶ㄣ 提交于 2019-12-11 06:41:02
问题 I have a number of similarly structured FormViews. In an effort to avoid duplicate markup, I've created a master page that contains the FormView, and placed a ContentPlaceHolder inside the FormView. The specific databound controls - which are the only thing that change from page to page - are then on the page that uses that master page. So I have a master page that looks something like this: <%@ master ... %> ... <form runat=server> ... <asp:formview runat="server" ... > <edititemtemplate> ..

Master Page content filtering with respect to asp page

我是研究僧i 提交于 2019-12-11 06:19:45
问题 I have a Master page having title and menu, now i want if i open login.aspx page, the menu of the master page should be hided, rest title will remain there, means master page is required but without menu, what is the best solution for this? 回答1: Get the menu control and set its Visible property to false Warning: this good is finding control with hard coded ID so it may trow NullReferenceException Menu menu = Page.Master.FindControl("Menu1"); menu.Visible = false; 回答2: You can have a property