master-pages

Iframe Canvas application with Master Page

◇◆丶佛笑我妖孽 提交于 2020-01-05 04:04:04
问题 I am developing an Iframe-Canvas Application. I am using Master Page to gain permission access & display few details, that works good. Then on content Page I want to display a textbox & linkbutton so user can post status on their wall & here I get error (OAuthException) An active access token must be used to query information about the current user. here's my code : Site.master.cs protected void Page_Load(object sender, EventArgs e) { var auth = new CanvasAuthorizer { Permissions = new[] {

Cross-Project Master Page

感情迁移 提交于 2020-01-04 14:21:37
问题 I asked a "similar" question here: Visual Studio Multi-Project Solution Options However, that did not specifically address my problem. In short: what is the best way to share a master page across a multi-project solution? I have a solution with over 20 internal Web app projects and want a common master page for all of these. UPDATE: I will need to share other resources also - CSS, images, JS files, etc. 回答1: Perhaps you could take advantage of NuGet? You could create a custom package, and

Mixing Razor Views and Web Forms Master Pages

允我心安 提交于 2020-01-04 07:54:09
问题 I'm attempting to do what Scott Hanselman describes below: http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx I have a Web Form user control with code behind that is called from the Web Form and Razor Master Pages that is not working in the Razor layout: <div id="navtop"> @{ Html.RenderPartial("~/Controls/MasterPageMenu.ascx"); } </div> The user control contains the following: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MasterPageMenu.ascx

ASP.NET Calling a Method in (ASPX) From a UserControl (ASCX)?

狂风中的少年 提交于 2020-01-04 06:15:32
问题 got an Default.aspx its Codebehind has a Method: public void DoSomething(){} The Default.aspx has got a UserControl.ascx In the Codebehind of my UserControl.ascx I would like to call my DoSomething() from Default.aspx , but this doesn't works: Default defaultPage = new Default(); defaultPage.DoSomething(); How can I achieve this? ( Default.aspx is also the StartupPage of the Masterpage) 回答1: Default defaultPage = new Default(); would create a new instance of your page, which isn't what you

ASP.NET call a controller method from the master page?

你说的曾经没有我的故事 提交于 2020-01-02 09:55:44
问题 In ASP.NET MVC2 how do you call a controller method from the master page? Say for example I wanted to include some overview data in the master: +--------------------------------------+ | Logo Welcome xyz| +--------------------------------------+ | total sales this month $999 | +--------------------------------------+ | Home | Sales | Import | Export (menu)| +--------------------------------------+ And I have inside the Sales controller this method: public ActionResult TotalSalesThisMonth() {

Why master page doesn't have PreInit event in ASP.NET?

你离开我真会死。 提交于 2020-01-02 04:32:28
问题 The following is the sequence in which events occur when a master page is merged with a content page: Content page PreInit event. Master page controls Init event. Content controls Init event. Master page Init event. Content page Init event. Content page Load event. Master page Load event. Master page controls Load event. Content page controls Load event. Content page PreRender event. Master page PreRender event. Master page controls PreRender event. Content page controls PreRender event.

Only Content Controls are Allowed (C# webcontrols)

断了今生、忘了曾经 提交于 2020-01-02 03:51:07
问题 So, I'm not sure what's going on. My boss wasn't pleased with me using MVC and Razor, so I'm being forced to code with this nasty webcontrol/codebehind style. =/ The error is: Only Content controls are allowed directly in a content page that contains Content controls. Here is the masterpage: <%@ Master Language="C#"%> <!DOCTYPE html> <html> <head> <title>Application Form</title> </head> <body> <div id="container"> <asp:contentplaceholder id="contentPlaceHolder" runat="server" /> </div> </body

How to disable/override naming container's ID generation of Content page's control id's

浪子不回头ぞ 提交于 2020-01-02 03:15:30
问题 We have an existing ASP.Net web application which we want to convert into using masterpages. In the process of doing this, I found that the HTML id's generated for the HTML elements are prefixed with the ContentPlaceHolder's id. And this is what can be expected when we set the ContentPlaceHolder's clientidmode=static. Now since we have a lot of existing client side scripts that make use of the id's, this part breaks when we use masterpages, and it is quite a big job to run through all our

How to disable specific menu item from menu control in asp.net C# code behind

好久不见. 提交于 2020-01-01 10:17:33
问题 In Master Page: <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Width="60%" BackColor="#336699" Font-Bold="True" ForeColor="White"> <StaticMenuStyle BackColor="#336699" /> <StaticSelectedStyle BackColor="#336699" /> <StaticMenuItemStyle BackColor="#336699" /> <DynamicHoverStyle BackColor="#336699" /> <DynamicMenuStyle BackColor="#336699" /> <DynamicMenuItemStyle BackColor="#336699" /> <StaticHoverStyle BackColor="#336699" /> <Items> <asp:MenuItem Text="Dashboard" NavigateUrl="~

How to handle master page button event in content page?

做~自己de王妃 提交于 2020-01-01 09:24:12
问题 There's more than question and article about the same exact question but I have a couple more related questions and was hoping to get some answers. I've heard of two approaches to find the button and add the handler or use an interface (Check both approaches from here) .. Which one do you suggest ? If you could please illustrate the 'Interface' option with some code and where to class the interface file cause it's not readable in the page when I try to inherit it! 回答1: Second aproach is IMO