master-pages

JQuery with MasterPage in ASP.NET

﹥>﹥吖頭↗ 提交于 2020-01-11 11:18:11
问题 I'm trying to use JQuery with some asp.net pages, that use master pages, and I'm having problems with loading the JQuery javascript file. When I include the file in the markup of the master page, it works just fine on pages that are in the same directory as the master page: <script src="jquery/jquery-1.4.2.min.js" type="text/javascript"></script> but that breaks for pages that aren't in the same directory as the master page. Master pages inherit the path of the page that includes them, so the

Call Method in Master Page

不问归期 提交于 2020-01-09 03:50:56
问题 I have a public method in my asp.net Master Page. Is it possible to call this from a content page and if so what are the steps/syntax? 回答1: From within the Page you can cast the Master page to a specific type (the type of your own Master that exposes the desired functionality), using as to side step any exceptions on type mismatches: var master = Master as MyMasterPage; if (master != null) { master.Method(); } In the above code, if Master is not of type MyMasterPage then master will be null

Error on adding <script> to master page

亡梦爱人 提交于 2020-01-07 07:09:05
问题 I have a Master page that have these ContentPlaceHolder : <asp:ContentPlaceHolder ID="title" runat="server"> </asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="contentTitle" runat="server" ></asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="content" runat="server"> </asp:ContentPlaceHolder> when I add these codes for jquery in <head> part of master page: <script type="text/javascript" src="script/jquery-2.0.1.min.js" /> <link href="script/jquery.contextMenu.css" rel="stylesheet" type=

Master page won't compile when referencing its own properties and members

拜拜、爱过 提交于 2020-01-07 02:10:05
问题 When upgrading a dotnet Web Site based on asp.net WebForms to a Web App I'm having trouble with Master pages. My Master pages contain, in their .aspx file markup, references like this: <div> Name: <% =GetUserName() %> Account: <% =AccountId %> </div> GetUserName() is a protected method defined in my master page's codebehind file, and AccountId is a protected field in the same place. After doing the Web App upgrade (which involves automatically generating a Site.Master.designer.cs codebehind

ASP.NET CustomError Handling in MasterPage Error Page

假装没事ソ 提交于 2020-01-06 05:07:49
问题 I redirect Errors to Error.aspx <system.web> <customErrors defaultRedirect="error.aspx" mode="On"> <error redirect="error.aspx" statusCode="500" /> </system.web> and the problem is that there is also second error in ErrorMasterPage of Error.aspx <script Language="C#" MasterPageFile="~/ErrorMaster.Master" runat="Server"> and CustomError can not handle the second error while its like a loop ( it will redirect to error.aspx and Masterpage of Error.aspx has Error. here is problem: Example: Login

Parser Error for Strongly Typed Master Page in MVC 2

半城伤御伤魂 提交于 2020-01-06 04:54:07
问题 I am trying to create a STRONGLY TYPED Master Page (MVC 2.0) and getting following error: Parser Error Message: Could not load type 'System.Web.Mvc.ViewMasterPage<Resorts.Services.ViewModels.BaseView>'. Here is my code inside Master Page: <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<Resorts.Services.ViewModels.BaseView>" %> <%@ Import Namespace="Resorts.Services.ViewModels" %> Resorts.Services.ViewModels.BaseView is inside a seperate assembly and its referenced in Master

ASP.NET 4.5, ImageButton OnClick not firing on MasterPage

余生颓废 提交于 2020-01-06 02:55:08
问题 I have an ImageButton in MasterPage and it's not firing OnClick Event. In pages without a masterpage it works. http://www.quotehd.com/default.aspx does not have a masterpage and if you enter the word 'funny' in search it works, but if you try to search from http://www.quotehd.com/topics which uses the masterpage it does not fire the code from masterpage. this is the MasterPage aspx code: <asp:ImageButton ID="lnkGo1" runat="server" CssClass="searchsubmit" ImageUrl ="/content/themes/pin/images

Masterpage -> SubMasterPage -> Web Form…getting properties of Masterpage in sub pages

眉间皱痕 提交于 2020-01-05 13:27:28
问题 I asked a related question on this yesterday, and was told what not to do, but not what I should do. I've got a master page that I'll call "TheMaster". I've got 2 sub master pages "Sub1" and "Sub2". They both have a Masterpage directive of "TheMaster". Web Forms have a Masterpage directive of "Sub1" or "Sub2". These aren't the real names. In "TheMaster", I figure out what page the user is on, find out where in the Web.sitemap they are, and using that, I have the Web.sitemap node and the

Aspx, global instance of class, possible bug in code structure

寵の児 提交于 2020-01-05 07:46:14
问题 I am tracking down a bug in some old aspx code. The problem is that one some very rare occations (1/10.000 pageviews or so) two users are mixed up, ie. user A sees user B data. Here is how the code is structured: We have a user class which is defined in a module like this: Public Module MyGlobals Public myUser As CMyUser End Module On the loginpage, we validate the username/password and if valid then the coorosponding userid is loaded from db, and we do: FormsAuthentication.SetAuthCookie

php website one page for design

心已入冬 提交于 2020-01-05 07:17:31
问题 I'm done creating a php website that has 6 pages, and the structure of the pages is the same for each one of them, the only thing that changes is the content, so is the same header, same design and same footer, the only thing that changes like I said before is the content itself. so i was thinking instead of having many pages, I could have only one design page, and change only the content, what do you recommend?,and how do I do that?, also im not planning installing anything like Typo3,