master-pages

Why won't postbacks work on my domain root?

孤者浪人 提交于 2019-12-11 04:37:25
问题 I have a form on a masterpage which is very simple but will not work when the site is at the root. Works fine: www.mysite.com/page.aspx www.mysite.com/another/page.aspx Does not work: www.mysite.com I click the button and it postsback to www.mysite.com/default.aspx But nothing has executed, now if I try the form again on /default.aspx it will postback and execute fine. What am I doing wrong? 回答1: It sounds to me like the default page redirection is either accidentally (or intentionally)

Base Page or Base Master Page or Nested Masters?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 03:48:34
问题 I've got a site with two master pages: one for one-column layout and one for two-column layout. These are nested within a master page that provides a common header and footer. I have functionality that I want each of the content pages to have; should I: create a page base class and inherit that inside my content pages, or create a master page base class and inherit that inside one of my levels of nested master page? Ultimately I want the content pages to have access to a connection object and

Visual Studio 2013 C#: one solution consume code of another solution

淺唱寂寞╮ 提交于 2019-12-11 03:45:00
问题 I have Java background and am trying to start on C#. I wanna create a lib in C# that will be used in other solutions. In Eclipse it's just a matter of creating a jar and adding it to classpath. I know each project in VS2013 becomes a dll, but how can I make a solution see these dll? Also, in Eclipse, we can create a Web Fragment Project. It can have Servlets, jsp and static js and css files, it becomes a war file and can be imported into another project and its files be used in that project.

Master page gives error

一个人想着一个人 提交于 2019-12-11 03:39:51
问题 I am using VS2008 for ASP.NET apps. My Solution Explorer has hierarchy like this: The start-up page, Default.aspx, displays a Login form. When I press Login button, another Page with the name, selectCompany, should open. selectCompany is a Web Content Form whose master page is Master1.Master. But it is not opening, instead I am getting this error: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific

How to work with Master Page that is attached to the page via the page's basepage?

一世执手 提交于 2019-12-11 02:18:49
问题 In my ASP.Net web application, I have a base page that implements functionality that spans all pages of the web application and my web pages derive from this base page. Since there is a single master page for the entire website, I don't want to attach the master page in each of the web pages. So I attached the Master page via the basepage's OnPreInit method as follows: protected override void OnPreInit(EventArgs e) { this.MasterPageFile = "~/Site.master"; base.OnPreInit(e); } However, when I

ASP.net - The virtual path '/Master.master' maps to another application, which is not allowed

江枫思渺然 提交于 2019-12-11 00:48:13
问题 I have an asp.net master page located in the root directory of my site. I have a page in the directory "/myfolder" from the master page: <%@ Page Title="" Language="C#" MasterPageFile="../Master.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="myproject.TimelapseDefault" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <p> The files look like: /Master.master /myfolder/default.aspx Why do I get this error, when I upload it to my (non

How to get JqueryUI to work with ASP.Net Master Pages and multiple paths?

泄露秘密 提交于 2019-12-10 23:14:43
问题 I have a simple ASP.Net 4.0 website that uses a master page that I would like to include JqueryUI. The Head looks like this. <head runat="server"> <title></title> <link href="~/css/Main.css" rel="stylesheet" type="text/css" /> <script src="js/jquery-1.6.2.min.js" type="text/javascript"></script> <script src="js/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script> <link href="js/jquery-ui-1.8.16.custom/css/cupertino/jquery-ui-1.8.16.custom.css" rel=

The name 'ViewData' does not exist in the current context

谁都会走 提交于 2019-12-10 18:59:36
问题 I am working over my first application over MVC3 and still kind of a newbie in it: I’m trying to success my ViewData[] over a master page because its contains a message that would be used over every page, but when I’m trying to access that it says: CS0103: The name 'ViewData' does not exist in the current context var msg = ViewData["msg"] as string; //var msg = ViewBag.msg as string; if (msg != null) { Response.Write (msg); } else if (msg == null) { Response.Write(""); } I am not sure whether

How to store an ASP.NET master page in a common library?

徘徊边缘 提交于 2019-12-10 16:07:38
问题 We would like to have several internal web applications which use the same master page. Is there a way to store a master page in a common library referenced by all projects? 回答1: You can do this, but it is difficult and has quite a few drawbacks. This process is similar to packaging up user controls as well. Basically you have a web application project that contains your master page. You can precompile this into a set of dlls using aspnet_compiler. then you can use ilmerge.exe to put them all

Only Content controls are allowed directly in a content page that contains Content controls

∥☆過路亽.° 提交于 2019-12-10 15:32:53
问题 I'm trying to add a content place holder into a master page but getting the above error. The master page inherits itself from another master page and many of the ContentPlaceHolders of the child master are wrapped in Content tags which inject the content from the inheriting page into the place holders of the parent master. However, I want the child master to deviate a little from the base master, but having its own ContentPlaceHolder unrelated to the parent master. Yet it seems to not like