master-pages

Accessing masterpage properties from child pages in ASP.net VB

旧时模样 提交于 2019-12-23 07:48:06
问题 I have masterpage.master.vb where I have properties, such as; Private _SQLerror As String Public Property SQLerror() As String Get Return _SQLerror End Get Set(ByVal value As String) _SQLerror = String.Empty End Set End Property Then I have an aspx page in which I need to use this property in, such as; If **[masterpage property sqlerror]** = Nothing Then InternalSQLErrLabel.Text = ("No Errors Reported") End If Can anyone give me an idea how to go about this? I've tried searching but most

How to apply css class to an html element using jquery in ASP .NET MVC?

限于喜欢 提交于 2019-12-23 04:09:15
问题 I'm trying to implement a tab menu just like the one in Stack Overflow. I created an HTML list and styled it to look like tab menus using CSS. I put the HTML list on the master page. Now, how do you change the color of the list once it's clicked by the user? For example, if you click the Stack Overflow "Users" tab menu, it will redirect you to the "Users" index view, and then change the color of the tab menu to orange. How do I achieve this? 回答1: You dont and shouldnt use Jquery for this. The

ASP.net get content page to change master page control

匆匆过客 提交于 2019-12-23 02:36:07
问题 Master page: <form runat="server"> <Scirra:MainMenu runat="server" ID="MainMenu" TopTabSelected="home" SubTabSelected="link2" /> <asp:ContentPlaceHolder id="MainContent" runat="server"> snip Content page: Master.MainMenu.TopTabSelected = "forum"; I know I'm probably doing this wrong, but is this possible? I want to change a parameter of that control. It says 'inaccessible due to protection level' . 回答1: You should provide a public property f.e MenuTabSelected in your MasterPage that Gets/Sets

Anyone Using a Custom ViewMasterPage?

杀马特。学长 韩版系。学妹 提交于 2019-12-22 18:36:10
问题 Lately when I've been building my asp.net mvc apps I tend to have a number of items that consistently need to be calculated, formatted and configured in my master pages. Some of these items include: I like to attach specific classed to the body tag like WordPress does to help my CSS out. I usually attach the name of the action, controller, page template, etc. I like to work with a custom IIdentity in my master pages. This IIdentity includes the users nice Display Name, UserID, UserName, etc.

How do I reference a master page from an aspx page?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 17:54:28
问题 How do I reference a master page from an ASP.NET webform? The following statement does not work: this.MasterPage.Page.Title = "My Title"; 回答1: In your aspx, below the Page directive, write: <%@ MasterType VirtualPath="YourMasterFile" %> And then from your code, write Master. anything that you want to use, for example: Master.Title = "My Title"; 回答2: you have to cast this.MasterPage into the type of masterpage you have, and then you can access it as you'd expect var mp = this.MasterPage as

Highlighting the selected jquery tab using asp.net Master page

匆匆过客 提交于 2019-12-22 16:44:07
问题 I am using jquery tabs(First,Second,Third) in multiple asp.net pages (First.aspx, second.aspx,Third.aspx) in my asp.net website and in each page i am writing the ul,li code. For example in the First.aspx page I am writing the following code inside the 'ul' tag <li class="current"><a href="#First">First tab</a></li> <li><a href="Second.aspx">Second tab</a></li> <li><a href="Third.aspx">Third tab</a></li> Similarly in the second.aspx,Third.aspx pages i am using the Class="current" to highlight

Best Practice for multiple asp.net web applications

我们两清 提交于 2019-12-22 11:11:28
问题 Looking for the best practice when having multiple web applications within one ASP.NET "site" or "solution". I have a few options I am toying with: old faithful of putting all applications and Site master into one Solution / one web application My boss is worried about having 30 'applications' that are all under the same project in VS and every time we make a change to one have to deploy to all. So this makes us want to break out each into a separate project under the same solution. This

How to dynamically change master page's master page?

人盡茶涼 提交于 2019-12-22 08:59:11
问题 I am trying to change the master page dynamically, and although it's easy to do from a content page (overriding OnPreInit ), there is no such event for a master page. Is it possible to introduce this event somehow? UPDATE: I got halfway there by going via the PreInit of the pages at the bottom of the ladder, turns out you can do things like base.Master.MasterPageFile = "/master.Master"; , but for some reason this doesn't load the stuff in the header of the top-most master page, namely

how to add controls to the masterpage's content placeholder programmatically

萝らか妹 提交于 2019-12-22 01:14:31
问题 On the base.master: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Base.master.cs" Inherits="WebApplicationControlTest.Base" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>The title</title> <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div> There is a

Internet Explorer markup errors when using Google Feed API in master page

≡放荡痞女 提交于 2019-12-22 00:20:09
问题 I'm using Google Feed API to display an RSS-feed on a customers SharePoint intranet, which works perfect with Chrome, Firefox and other modern browsers. The exception is of course Internet Explorer, both 10 and 11 which we've committed to support. The feed is shown only some times, but the errors thrown in the developer console of IE10 or IE11 are always thrown, even when the feed is displayed. I reference the jsapi source as Google suggests, with a regular <script> tag like <script type=