master-pages

how can i insert login control on the top of default page

时光怂恿深爱的人放手 提交于 2019-12-12 06:19:33
问题 in my master page there is a login status when i click on it the page is redirected to login page.now i want to create login control in the home page itself so that users dont have to visit loginpage again and again..i guess i cant create the login control in the masterpage .it has to be in the default page but then how can i put that control on the top of the page . i have also used login control in masterpage but then my other control ion login page doesnt work properly 回答1: You can add a

Variables from Master Page always empty

血红的双手。 提交于 2019-12-12 05:28:57
问题 I have these variables set on my MasterPage public string CurrentUser = ""; public string UserDomain = ""; protected void Page_Load(object sender, EventArgs e) { string Name = System.Security.Principal.WindowsIdentity.GetCurrent().Name; string[] userDetails = Request.LogonUserIdentity.Name.Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries); UserDomain = userDetails[0]; CurrentUser = userDetails[1]; } In a child page I am simply trying to read those values back: CurrentUser =

access database info in a partial view, .ascx that is included in Site.Master in asp.net mvc

不问归期 提交于 2019-12-12 05:28:36
问题 Hi i'm having problems with this. I am developing an asp.net mvc 2 application. I have a partial view menu.ascx defined. this gets included on all the pages of my site in the Site.Master masterpage. Now the thing is I want my menu to change according to the type of user. Here's what I did at first: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %> <li><%: Html.ActionLink("Home", "Index", "Home")%></li> <% ExtendedMemberShip.MemberShipUser user =

MasterPage.master inheriting from another class that inherits MastPage

倾然丶 夕夏残阳落幕 提交于 2019-12-12 04:46:28
问题 I have my master page inheriting from a class called MasterParent. During compilation, I get an error as following: Compilation Error: Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g.

ASP.NET: Having common Page title in master page with each page adding page-specific title?

☆樱花仙子☆ 提交于 2019-12-12 01:37:49
问题 My master page looks like: <head runat="server"> <title> <asp:ContentPlaceHolder ID="PageTitlePlaceHolder" runat="server" /> </title> Content pages look like: <asp:Content ID="TitleContent1" ContentPlaceHolderID="PageTitlePlaceHolder" runat="Server"> My Page </asp:Content> This works by placing the content page specific title on the page ("My Page" in this example). Now I want to add a global prefix to the title in my master page for the site name. So I want: <head runat="server"> <title>

registering a javascript file from a master page

那年仲夏 提交于 2019-12-12 01:22:18
问题 Is there any reason why registering a javascript file from the head tags of an ASP.NET master page wouldn't work? For example, I have the following (plus many other) file referece: <script type="text/javascript" src="/js/jquery/jquery-1.4.2.min.js"></script> but jquery (and every other JS reference) doesn't work when the page loads. Any thoughts? Thanks. 回答1: If that doesn't work, you can try this: <script type="text/javascript" src="<%# ResolveUrl("~/js/jquery/jquery-1.4.2.min.js") %>"><

How to replace the jQuery library set in the MasterPage, from a Content Page?

久未见 提交于 2019-12-11 19:19:06
问题 I have this problem My project has a master page and content pages, I have in Master Page this code <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script> but i need use this in only one content page <script type="text/javascript" src="js/jquery-1.5.2.min.js"></script> how I do work ? 回答1: On your Master Page, add a ContentPlaceHolder to wrap the jQuery library script: <asp:ContentPlaceHolder ID="jqContentPlaceHolder" runat="server"> <script type="text/javascript" src="js

how to use document.ready function on child pages

僤鯓⒐⒋嵵緔 提交于 2019-12-11 19:17:15
问题 i need to use JavaScript on my website. When i create new web page,which is properly work with JavaScript. When i create a new web page, which is child page, derived from master page. this page does not support my JavaScript. I use this code for auto-complete property for multiple words. My code is here: JavaScript code in content place holder in header <%@ Page Language="C#" MasterPageFile="~/Master_Front.master" AutoEventWireup="true" CodeFile="Mailbox.aspx.cs" Inherits="Mailbox" Title=

hiding buttons in master page

青春壹個敷衍的年華 提交于 2019-12-11 16:24:44
问题 I am working on an app where i am having some linkbuttons in master page. I want to display them depending upon the authorization given to them once they logs in. I have initially made all of them visible false and then i am checking the authorisation in the aspx.cs class of master page. I make the link button visible depending upon the right granted to the user. But it is making all the link buttons visible. Instead it should only make two of them visible and rest should be hidden. Following

how to make the footer to stick exactly at the bottom of the page?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 16:03:32
问题 I'm using ASP.net Master page. I've a footer in my page. When content of my page is less, the footer is coming in the middle of the page. What do i need to do. please suggest. Thanks. 回答1: One more link for the same think http://www.cssstickyfooter.com/ 回答2: You can implement a CSS sticky footer: http://ryanfait.com/sticky-footer/. Using a little bit of CSS (see http://ryanfait.com/sticky-footer/layout.css) the footer will stick to the bottom as much as possible: If the page's content is