master-pages

How to set navbar item as active when user selects it?

末鹿安然 提交于 2019-12-31 22:39:14
问题 I am a new ASP.NET Web Forms developer and trying to use Twitter Bootstrap with the Master Page. I am struggling with setting navbar item as active when user selects it. I created my simple master page by following this tutorial about how to use Twitter Bootstrap with ASP.NET. Here's the code of my master page: <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title>

ASP.NET dynamically adding UserControl to PlaceHolder, not fire Click Event, only Page_Load

亡梦爱人 提交于 2019-12-31 05:01:09
问题 In my ASP.Net page I have PlaceHolder and Button. When user click on this button, I add some UserControls from my Interface method getControl to the PlaceHolder. Code: protected void ActionBtn_Click(object sender, EventArgs e) { if (provider != null) { actualObject = (PlaceHolder)provider.getControl(); PlaceHolder1.Controls.Add(actualObject); } } Method getControl: public object getControl() { ph = new PlaceHolder(); exportInbBtn = new Button(); exportInbBtn.Text = "Export Inventury";

Removing master layout from view (MVC2)

人盡茶涼 提交于 2019-12-31 04:41:07
问题 if i need remove master layout from my view, how can i do it in MVC2? i tried put code in my view that was shown in documentation http://sparkviewengine.com/documentation/master-layouts: , but it still bring my Application.spark layout :-/ any ideas why? 回答1: Not tested, but what if you create and empty master layout, and say <use master="EmptyMaster" /> in the top of your view? Or you could call on the empty master from the controller; return View("View", "EmptyMaster"); Don't know if it'll

How to hide content on certain pages and not others via a Master Page?

眉间皱痕 提交于 2019-12-31 02:53:13
问题 Read this thread but didn't really answer my question and there were quite a few suggestions so not sure if they are on the right track: Master Page content filtering with respect to asp page What I have is a site with 1 Master Page and in it is a global footer that all pages use. I want to eliminate the footer on only 1 page (i.e. the login page) but keep all the other master page content intact. I know I could create a separate Master Page just for this login page but it seems overkill. Is

Inline tag not executing in an asp.net master page

断了今生、忘了曾经 提交于 2019-12-31 01:44:08
问题 This really should be so very simple... I have an asp.net master page which is working as expected. It includes some asp: tags without any problems. The master page also includes the line <link rel="stylesheet" type="text/css" href="css/main.css?v=<%=variableName%>" /> which is not executing. The output HTML has this as <link rel="stylesheet" type="text/css" href="css/main.css?v=<%=variableName%>" /> I do not work in asp.net very much so hopefully I have missed something super simple. Any

Too many JavaScript and CSS files on my ASP.NET MVC 2 Master Page?

喜欢而已 提交于 2019-12-30 11:41:29
问题 I'm using an EditorTemplate DateTime.ascx in my ASP.NET MVC 2 project. <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DateTime>" %> <%: Html.TextBox(String.Empty, Model.ToString("M/dd/yyyy h:mm tt")) %> <script type="text/javascript"> $(function () { $('#<%: ViewData.TemplateInfo.GetFullHtmlFieldId(String.Empty) %>').AnyTime_picker({ format: "%c/%d/%Y %l:%i %p" }); }); </script> This uses the Any+Time™ JavaScript library for jQuery by Andrew M. Andrews III. I've added

In what order asp.net master pages execute

試著忘記壹切 提交于 2019-12-30 07:27:12
问题 I m using master page in my project. I want to know the order in which the page loads of both master page and web page executes also about the scripts 回答1: Master page child controls initialization: All server controls contained within the master page are first initialized. Content page child controls initialization: All server controls contained in the content page are initialized. Master page initialization: The master page itself is initialized. Content page initialization: The content

How do you access user controls on a masterpage from the asp:content page using the master?

空扰寡人 提交于 2019-12-30 07:22:06
问题 I keep getting these requests for 'make me a tool to do xyz' for a web app we're putting up. So after the third one, I realized it'd be easier to lump them all together and use a master page. I've got a user control called MessageCenter I use for error, success, and informational messages, and so I dropped that on the master page. <%@ Master Language="VB" CodeFile="tfMasterPage.master.vb" Inherits="tfMasterPage" %> <%@ Register Src="MessageCenter/msgCenter.ascx" TagName="msgCenter" TagPrefix=

ASP.net access a master page variable through content page

你说的曾经没有我的故事 提交于 2019-12-30 05:55:12
问题 I have a master page: <%@ Master Language="C#" AutoEventWireup="true" Codefile="AdminMaster.master.cs" Inherits="AlphaPackSite.MasterPages.AdminMaster" %> Then I have a public variable: public partial class AdminMaster : System.Web.UI.MasterPage { protected bool blnShowDialogue = false; In my content page I would like to set this variable: blnShowDialogue = true; So that in my master page I can have the code: $(function() { <%if(blnShowDialogue == true){%> $("#dialog").dialog(); <% } %> }

Preferred way to include relative reference to JavaScript in VS 2008 nested Masterpage

假如想象 提交于 2019-12-30 04:38:19
问题 Our base Masterpage has something like the following <head runat="server"> <title></title> <script type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/actions.js")%>"></script> <script type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/jquery/jquery-1.2.6.min.js")%>"></script> <asp:contentplaceholder id="cph_htmlhead" runat="server"> </asp:contentplaceholder> </head> If this Masterpage is the Masterpage for an ASPX page things work fine. If this Masterpage is