master-pages

Call User Control Method in Master Page from Content Page

ぃ、小莉子 提交于 2019-12-24 10:49:58
问题 I have a Custom User Control present in my master page that loads site-wide JavaScript libraries into the master page's head Like so: <html> <head> <CustomControl:MyScriptControl id="scripts" runat="server" /> </head> <body> <asp:ContententPlaceHolder id="pageContent" runat="server" /> </body> </html> I would like to have the page that uses the MasterPage call a method of the User Control MyScriptControl so essentially public partial class ChildPage: System.Web.UI.Page { protected void Page

what is the best way to bind ViewModel data to master page in asp.net-mvc

安稳与你 提交于 2019-12-24 10:39:26
问题 I want to dynamically create my menu on my master page and i have seen 2 different approaches: First approach is have a base controller that loads up all shared view model data in its constructor. This is described here Second approach is to create a separate controller for this and use this in your master page to inject specific view pieces into the master page without polluting your regular page view generation: @Html.Action("Index", "Settings") Is one better than the other? Is there any

Google Maps API 3 is acting buggy

前提是你 提交于 2019-12-24 09:08:05
问题 I'm trying to put a google map within a jqueryui tab. The map shows up; however, the full map itself does not fill its canvas. Additionally, trying to scroll the map makes it jumpy. Does anyone have any ideas? Here is the code I'm using: <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="TabsExample.aspx.cs" Inherits="TabsExample" %> <asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server"> <link href="css/jquery-ui-1.9.2.custom

css3PIE or PIE.htc in Asp.net

百般思念 提交于 2019-12-24 06:35:44
问题 Well I used css3pie in asp.net which is not working. I tried every possible solution. Searched a lot of forums but failed to properly use PIE in asp.net. Let me show you my project structure. I have master and inner master pages in my project hierarchy. The css3pie is working on those pages which don't use master pages. My css and .htc files are as follows Root css script When I use css3PIE without Master page the it works: <script type="text/javascript" src="../Scripts/html5.js"></script>

ASP.Net, Master Pages : style-sheet per page

穿精又带淫゛_ 提交于 2019-12-24 04:52:02
问题 Those are my assumptions, are these correct? Layout using CSS is preferred over using tables. CSS ishould be extracted in a separate file, rather than in-lined. CSS are imported (linked) from that is located in the site.master, therefore all .css are imported for (and apply to) all .aspx pages. Given that, I have a project with one master page, and two .aspx pages. Each of those pages has a table with id "records". Question: Can I import a .css file for each individual .aspx page? Is there a

Server Side Includes vs. ASP.NET Techniques is there a performance difference?

走远了吗. 提交于 2019-12-24 02:04:40
问题 I was recently hired to update an ASP.NET 1.0 site, created before master pages were available. Hence the pages have server side includes (ssi) like <!-- #include file="footer.html" --> . I was about to update the *.aspx pages with a master page that contained the markup previously in the ssi's. I'm convinced this is the right thing to do, especially from a maintainability perspective. However a co-worker firmly believes performance would suffer as supposedly ssi's are a very 'lightweight'

Masterpage CSS link can't resolve ~

*爱你&永不变心* 提交于 2019-12-24 00:56:05
问题 I'm working on a web interface in C# ASP.net. If it matters, I'm using XHTML 1.0 Transitional. This website has a masterpage thing going, and that's where the problem came in. When I used a real absolute path for the CSS link in the header, everything was fine. But then when I tried to switch it to tilde notation, all the styling broke. Here's a fragment of the original master page, which worked fine: <head> <title>Account Information</title> <link href="/css/main.css" rel="stylesheet" type=

Error Creating Control vs2010 MasterPage

久未见 提交于 2019-12-24 00:02:18
问题 Someone can explain this error? Error Creating Control - head Object reference not set to an instance of an object. <%@ Page Title="" Language="C#" MasterPageFile="~/Controls/Master1.Master" AutoEventWireup="true" CodeBehind="GrupoUsuario.aspx.cs" Inherits="GrupoUsuario" %> <asp:Content ID="Content1" runat="server" contentplaceholderid="head"> </asp:Content> I Think this is a bug of visual studio 2010 in design view. I'not using any event to manipulate session object in the method OnInt().

Call masterpage function from contentpage in asp.net?

百般思念 提交于 2019-12-23 16:10:03
问题 I have a function on masterpage and i want to call it from content page from codebehind. this is my trying : ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert__", string.Format("setStatusBarMessage('{0}',{1});", barMessage, type, ""), true); "setStatusBarMessage" function is declare in masterpage , so this code doesnt working. setStatusBarMessage is a client side function. MasterPage: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Content.master.cs" Inherits=

asp.net mvc file upload is passed as null to view model

寵の児 提交于 2019-12-23 14:23:59
问题 I have a form which uploads a photo to my database, and I use a view model to aid in this process. View Model: public class GalleryViewModel { //Members: public Gallery _photo { get; set; } public string _title { get; set; } public string _description { get; set; } public string _photographer { get; set; } public HttpPostedFileBase uploadFile { get; set; } // Ctor public GalleryViewModel(Gallery photo) { _photo = photo; } public GalleryViewModel() { _photo = null; } } When I debug the code, I