Search Results

Search found 104 results on 5 pages for 'contentplaceholder'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • jQuery document.ready + Asp.Net ContentPlaceholder cause Visual Studio intellisence problems

    - by Konstantin
    Hi! I want to execute JavaScript when document is ready without much syntax overhead. The idea is to use Site.Master and ContentPlaceholder: <script type="text/javascript"> $(document).ready(function () { <asp:ContentPlaceHolder ID="OnReadyScript" runat="server" /> }); </script> and in inherited pages just write plain code: <asp:Content ID="Content3" ContentPlaceHolderID="OnReadyScript" runat="server"> $("#Login").focus(); </asp:Content> It works fine but Visual Studio complains and gives warnings. Warning in master page is Expected expression at the line <asp:ContentPlaceHolder. In inherited pages warning is Could not find 'OnReadyScript' in the current master page or pages. I tried using Writer.Write in master page to render script tag and wrapping code: <% Writer.Write(@"<script type=""text/javascript"">$(document).ready(function () {"); %> <asp:ContentPlaceHolder ID="OnReadyScrit" runat="server" /> <% Writer.Write(@"});"); %> but page rendering terminates after opening script tag is rendered. Html basically ends with <script type="text/javascript"> How can I make it work?

    Read the article

  • Master page managing ContentPlaceHolder

    - by lidermin
    Hi, this is my issue: I have a master page in C#, where I have this code: <div style="width: 30%;height: 500px;float:left"> <asp:ContentPlaceHolder ID="cphMenu" runat="server"> </asp:ContentPlaceHolder> </div> <div style="width: 65%;height: 500px; float:right"> <asp:ContentPlaceHolder ID="cphMain" runat="server"> </asp:ContentPlaceHolder> </div> As you can see, I have two ContentPlaceHolders, the first one is the left menu (cphMenu), and the second one is the page itself. So, I want to click an item from the menu (the menu is a treeview) and load that specific page on the second contentplaceholder (cphMain). How can I get that behaviour?? Thanks in advance.

    Read the article

  • ContentPlaceHolders: Repeated Content

    - by brad
    Scenario I have an application using asp.net Master Pages in which I would like to repeat some content at the top and bottom of a page. Currently i use something like this: Master Page <html> <body> <asp:ContentPlaceHolder ID="Foo" runat="server"> </asp:ContentPlaceHolder> <!-- page content --> <asp:ContentPlaceHolder ID="Bar" runat="server"> </asp:ContentPlaceHolder> </body> </html> Content Page <asp:Content ID="Top" ContentPlaceHolderID="Foo" runat="server"> <!-- content --> </asp:Content> <asp:Content ID="Bottom" ContentPlaceHolderID="Bar" runat="server"> <!-- content repeated --> </asp:Content> Maintenance As you know, repeating things in code is usually not good. It creates maintenance problems. The following is what I would like to do but will obviously not work because of the repeated id attribute: Master Page <html> <body> <asp:ContentPlaceHolder ID="Foo" runat="server"> </asp:ContentPlaceHolder> <!-- page content --> <asp:ContentPlaceHolder ID="Foo" runat="server"> </asp:ContentPlaceHolder> </body> </html> Content Page <asp:Content ID="Top" ContentPlaceHolderID="Foo" runat="server"> <!-- content (no repetition) --> </asp:Content> Possible? Is there a way to do this using asp.net webforms? The solution does not necessarily have to resemble the above content, it just needs to work the same way. Notes I am using asp.net 3.0 in Visual Studio 2008

    Read the article

  • Adding title in contentplaceholder adds second empty title tag

    - by boris callens
    My master page has a contentplaceholder in the head tag. Because I want my page's title to represent the function of the current page and because I want the title to be translated in the user's language I have added a title tag in the page's head's contentplaceholder. All jolly and good except that now there appears a second, empty title tag that off course isn't valid. Any ideas how to solve this?

    Read the article

  • Diff between <head id="Head1" runat="server"> and <asp:ContentPlaceHolder runat="server" ID="HeadCon

    - by justSteve
    Looking for an better understanding of how an mvc project should define javascript and css includes. I'm working with sample code where includes are defined like: <head id="Head1" runat="server"> <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" />Affiliate Checkout</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="pragma" content="no-cache"> <script type="text/javascript" src="/Scripts/jquery.js"></script> <script type="text/javascript" src="/Scripts/jquery-ui-1.7.2.custom.min.js"></script> . . . <asp:ContentPlaceHolder runat="server" ID="HeadContent"></asp:ContentPlaceHolder> </head> I'm reading that to be that _all pages looking at this MasterPage will get jquery and jqueryUI and, additionally, each page will have the opportunity to add head elements thankx to the content placeholder HeadContent tag. The specific problem i'm troubleshooting is an instance where my rendered page is not including the 'prama no-cache' tag - as you see, it's defined in the upper level header section. Other .js and .css elements are making it into the rendered page so it very confusing to see that the no-cache tag isn't. When execute a 'View Generated Source' - the 'charset' is present the 'no-cache' is not.

    Read the article

  • How to show content from contentPlaceholder inline

    - by H4mm3rHead
    Hi, I have a page where i in my masterpage have a toolbar with a "Home" button to the far left. This button is not in a contentplaceholder but on the page. I want to have the opportunity for derived pages to add their own controls or whatever to the toolbar to be whown after the "home" button. But how to do this? I have tried to put in a content placeholder, but it seems that i cannot get it to show inline with the other stuff, it breaks and the content of the contentplaceholder is shown below the button instead. anyone know how to solve this? /Brian

    Read the article

  • Embedded Javascript in Master Page or Pages That Use Master Page throw "Object Expected Error"

    - by Philter
    I'm semi-new to writing ASP.Net applications using master pages and I've run into an issue I've spent some time on but can't seem to solve. My situation is that I have a master page with a structure that looks like this: <head runat="server"> <title>Test Site</title> <link rel="Stylesheet" type="text/css" href="Default.css" /> <script type="text/javascript" language="javascript" src="js/Default.js" /> <meta http-equiv="Expires" content="0"/> <meta http-equiv="Cache-Control" content="no-cache"/> <meta http-equiv="Pragma" content="no-cache"/> <asp:ContentPlaceHolder ID="cphHead" runat="server"> </asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div id="divHeader"> <asp:ContentPlaceHolder ID="cphPageTitle" runat="server"></asp:ContentPlaceHolder> </div> <div id="divMainContent"> <asp:ContentPlaceHolder ID="cphMainContent" runat="server"></asp:ContentPlaceHolder> </div> </div> </form> </body> I then have a page that uses this master page that contains the following: <asp:Content ContentPlaceHolderID="cphHead" runat="server"> <script type="text/javascript" language="javascript" > function test() { alert("Hello World"); } </script> </asp:Content> <asp:Content ContentPlaceHolderID="cphMainContent" runat="server"> <fieldset> <img alt="Select As Of Date" src="Images/Calendar.png" id="aAsOfDate" class="clickable" runat="server" onclick="test();" /> <asp:Button runat="server" CssClass="buttonStyle" ID="btnSubmit" Text="Submit" OnClick="btnSubmit_Clicked"/> </fieldset> </asp:Content> When I run this page and click on the image I get an "Object Expected" error. However, if I place the test function into my Default.js external file it will function perfectly. I can't seem to figure out why this is happening. Any ideas?

    Read the article

  • FormView templates break when refactored to Master/Content

    - by ZaijiaN
    Let's say I have an abstract class IA, with subclasses A1, A2, A3. For each subclass, I had a page with a FormView to insert/edit/view, with code specific to that class. The templates for insert/edit/view are all very similar, so it was mostly cut & paste, and the compiler had no problem that there were controls with the same IDs in the different templates. Something like this: <asp:FormView> <InsertItemTemplate> <asp:Label id="Label1" /> </InsertItemTemplate> <EditItemTemplate> <asp:Label id="Label1" /> </EdittItemTemplate> </asp:FormView> Much of the code/markup ended up being redundant across the pages, so I refactored it to use a master/content format, with the master page having content placeholders for the insert/edit/view templates. Master page: <asp:FormView> <InsertItemTemplate> <asp:ContentPlaceHolder ID="InsertItemTemplate"></asp:ContentPlaceHolder> </InsertItemTemplate> <EditItemTemplate> <asp:ContentPlaceHolder ID="EditItemTemplate"></asp:ContentPlaceHolder> </EdittItemTemplate> </asp:FormView> And content page: <asp:Content ContentPlaceHolderID="InsertItemTemplate"> <asp:Label id="Label1" /> </asp:Content> <asp:Content ContentPlaceHolderID="EditItemTemplate"> <asp:Label id="Label1" /> </asp:Content> In the content page templates, I'm doing the exact same thing I was doing before I refactored, but now the compiler is blowing up with the error BC30260: 'Label1' is already declared as 'Protected WithEvents Label1 As System.Web.UI.WebControls.Label' in this class. For some reason, it's not separating the controls in the content blocks the same way it did when they were in the templates, even though the content placeholders are in the individual templates. Is there a way around this, other than to rename all my controls?

    Read the article

  • How do I run JavaScript in my ContentPlaceHolder?

    - by donde
    I had a load of javascript that ran well when everything was in one page. Now that I've separated it out, I'm not sure how to include the javascript, ssing the HEAD tag in in the master, and also, I had functions that ran when the body loaded but they are in the master too. By the way this is a .NET 2.0 app.

    Read the article

  • Can a masterpage reference another masterpage with the same content and contentplaceholder tags?

    - by Peach
    Current Setup I currently have three masterpages and content pages in the following hierarchy : One root-level masterpage that displays the final result. Call this "A" Two sibling pages that don't reference each other but contain all the same contentplaceholder elements, just in a different order with different <div>'s surrounding them. Both reference the root-level masterpage. Call these "B1" and "B2". Several content pages that reference one or the other sibling master pages above (not both). Call these "C1" through "C-whatever". Basically I have: Cn = B1 = A Cm = B2 = A This hierarchy works fine. Desired Setup What I want to do is add in a new level to this hierarchy (a new master page) between the content pages and the sibling masterpages. Basically so it's like this: One root-level masterpage that displays the final result. Two sibling pages plus a third sibling. Call it B3 A new middle masterpage that dynamically 'chooses' one of the sibling masterpages. The desired behaviour is to pass through the content given by C directly to Bn without modifying it. The only thing D actively does is choose which Bn. Call this new masterpage D. Several content pages that reference the new middle master page instead of the old siblings. The challenge to this is, I'm working within the confines of a rather complex product and I cannot change the original two sibling masterpages (B1 and B2) or content pages (C) in any meaningful way. I want: Cn = D = B1 = A Cm = D = B2 = A Ck = D = B3 = A Essentially, D should "pass through" all it's content to whichever B-level masterpage it chooses. I can't put this logic in the C-level pages. Additional Details All B-level pages have the same content/contentplaceholder tags, just ordered and styled differently. D can be as convoluted as it has to be, so long as it doesn't require modifying C or B. I'm using ASP.Net 2.0 Is this possible?

    Read the article

  • How do you set page level, page-SPECIFIC javascript events using a ContentPlaceHolder?

    - by donde
    I previously asked how to include Javascript in my page when I split the page into a MasterPage and ContentPlaceHolder (.NET 2.0 app) The issue was I only wanted the javascript functions on THAT page so I couldn't just put them on the masterpage. Based on the answers, I will inlcude common fucntions through MasterPage and can put the page-specific function right on the content page. However, 1 question remains: Events. I have 2 Javascript functions that I wanted to load when the page loads ala the HTML below. How do you load javascript page events on the specific content page? Or in the case below, the OnKeyPress event? <body onkeypress="javascript:keypressed();" onload="javascript:setDivVisibility();">

    Read the article

  • Using nested Master Pages

    - by abatishchev
    Hi. I'm very new to ASP.NET, help me please understand MasterPages conception more. I have Site.master with common header data (css, meta, etc), center form (blank) and footer (copyright info, contact us link, etc). <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="_SiteMaster" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="tagHead" runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="styles.css" type="text/css" /> </head> <body> <form id="frmMaster" runat="server"> <div> <asp:ContentPlaceHolder ID="holderForm" runat="server"></asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="holderFooter" runat="server">Some footer here</asp:ContentPlaceHolder> </div> </form> </body> </html> and I want to use second master page for a project into sub directory, which would contains SQL query on Page_Load for logging (it isn't necessary for whole site). <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Project.master.cs" Inherits="_ProjectMaster" MasterPageFile="~/Site.master" %> <asp:Content ContentPlaceHolderID="holderForm" runat="server"> <asp:ContentPlaceHolder ID="holderForm" runat="server" EnableViewState="true"></asp:ContentPlaceHolder> </asp:Content> <asp:Content ContentPlaceHolderID="holderFooter" runat="server"> <asp:ContentPlaceHolder ID="holderFooter" runat="server" EnableViewState="true"></asp:ContentPlaceHolder> </asp:Content> But I have a problem: footer isn't displayed. Where is my mistake? Am I right to use second master page as super class for logging? Project page looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" MasterPageFile="~/Project.master" %> <asp:Content ContentPlaceHolderID="holderForm" runat="server"> <p>Hello World!</p> </asp:Content> <asp:Content ContentPlaceHolderID="holderFooter" runat="Server"> Some footer content </asp:Content>

    Read the article

  • MVC Page not showing up, 404 not found

    - by mwright
    I have a very simple MVC site that is returning a 404 not found error when trying to load a page at the very beginning. I'm looking for some direction to troubleshoot this problem since there is really nothing to go on from the error message. The error I'm getting is: Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /Views/Other/Index.aspx Below I have included the code for the various pieces, routing rules are default: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional} // Parameter defaults ); The site is using nested MasterPages, not sure if this is involved with the problem but trying to include as much detail as possible. I have: Controllers OtherController Views: Shared Folder: Site.Master Other Folder: Other.Master Index.aspx Site.Master Code: <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title> <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> </title> </head> <body> <div> <asp:ContentPlaceHolder ID="MainContent" runat="server"> </asp:ContentPlaceHolder> </div> </body> </html> Other.Master Code: <%@ Master Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewMasterPage" %> <asp:Content ID="OtherTitle" ContentPlaceHolderID="TitleContent" runat="server"> OTHER PAGE - MASTER TITLE <asp:ContentPlaceHolder ID="OtherPageTitle" runat="server"> </asp:ContentPlaceHolder> </asp:Content> <asp:Content ID="OtherContent" ContentPlaceHolderID="MainContent" runat="server"> Some other content. <asp:ContentPlaceHolder ID="PageContent" runat="server"> </asp:ContentPlaceHolder> </asp:Content> Index.aspx Code: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Other/Other.Master" Inherits="System.Web.Mvc.ViewPage" %> <asp:Content ID="IndexTitle" ContentPlaceHolderID="OtherTitle" runat="server"> Home </asp:Content> <asp:Content ID="IndexContent" ContentPlaceHolderID="OtherContent" runat="server"> Index content </asp:Content> OtherController Code namespace MVCProject.Controllers { public class OtherController : Controller { // // GET: /Member/ public ActionResult Index() { // Have also tried: // return View("Index", "Other.Master"); return View(); } } }

    Read the article

  • ASP.NET MVC: MetaTags; setting methodology, best practices

    - by MVCDummy09
    When I created a default MVC application in VS2K10, the master view (Site.Master) had a ContentPlaceHolder for the <title> tag. Is there a better way to set metatags like title and description than using a ContentPlaceHolder in the master and setting that ContentPlaceHolder's value in each view? How do you configure your views' metatags in a large-scale site with dozens and dozens of pages?

    Read the article

  • Access a content control in C# when using Master Pages

    - by Guillaume Gervais
    Good day everyone, I am building a page in ASP.NET, and using Master Pages in the process. I have a Content Place Holder name "cphBody" in my Master Page, which will contain the body of each Page for which that Master Page is the Master Page. In the ASP.NET Web page, I have a Content tag (referencing "cphBody") which also contains some controls (buttons, Infragistics controls, etc.), and I want to access these controls in the CodeBehind file. However, I can't do that directly (this.myControl ...), since they are nested in the Content tag. I found a workaround with the FindControl method. ContentPlaceHolder contentPlaceHolder = (ContentPlaceHolder) Master.FindControl("cphBody"); ControlType myControl = (ControlType) contentPlaceHolder.FindControl("ControlName"); That works just fine. However, I am suspecting that it's not a very good design. Do you guys know a more elegant way to do so? Thank you! Guillaume Gervais.

    Read the article

  • CSS not working in ASP.NET

    - by Tux
    Hi, I have created a simple page in HTML which works fine. But when I import that to ASP.NET, the page design clutters up. Here is my Site.Master <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Elite.WUI.Site" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body> <form id="form1" runat="server"> <asp:ContentPlaceHolder ID="headerCPH" runat="server"> <div id="header"> <h1>WUI</h1> </div> <hr /> </asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="navigationCPH" runat="server"> <div id="navigation"> <ul> <li>Home</li> <li>Users</li> <li>Campaigns</li> <li>Settings</li> </ul> </div> </asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="contentCPH" runat="server"> </asp:ContentPlaceHolder> </form> </body> </html> my stylesheet styles.css #navigation { float: left; border: 1pt solid; } #navigation ul { list-style-type: none; padding: 5 5 5 5; margin: 0; } #content { margin-left: 9%; border: 1pt solid; padding-left: 5; } and the actual page derived from master page <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ABC.aspx.cs" Inherits="Elite.WUI.ABC" %> <asp:Content ID="Content3" ContentPlaceHolderID="contentCPH" runat="server"> <div id="content"> <p>Test content</p> </div> </asp:Content> Here is how it is displayed in Firefox (ver 3.6) As you can see that the border, list-style-type properties are working but margin isn't working. Can anyone tell me what am I doing wrong? I have tested it in Google Chrome but same issue. While the HTML and CSS works fine when there is no ASP.NET i.e. simple .html file.

    Read the article

  • AsyncPostBackTrigger Just flashing/flicking the UpdatePanel but not updating it

    - by Pankaj
    I am trying UpdatePanel & AsyncPostBackTrigger on master pages through find control method but problem is when I click on button (UpdateButton) It just flash/flick (No Postback) the UpdatePanle but still it don't update or refresh the gridview (images) inside the updatePanel. I have placed script Manger on the master page & an AJAX Update panel in a ContentPlaceHolder in the child page. Also, in another ContentPlaceholder there is an asp button (outside of the UpdatePanel). I want to refresh/reload the AJAX UpdatePanel with this asp button. Thanks for suggestions. Child Page Code :- protected void Page_Load(object sender, EventArgs e) { ScriptManager ScriptManager1 = (ScriptManager)Master.FindControl("ScriptManager1"); ContentPlaceHolder cph = (ContentPlaceHolder)Master.FindControl("cp_Button"); Button btnRefresh = (Button)cph.FindControl("btnRefresh"); ScriptManager1.RegisterAsyncPostBackControl(btnRefresh); } protected void btnRefresh_Click(object sender, EventArgs e) { UpdatePanel1.Update(); } <%@ Page Title="" Language="C#" MasterPageFile="~/InnerMaster.master" AutoEventWireup="true" CodeFile="A.aspx.cs" Inherits="A" Async="true" %> <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Image ID="img12" runat="server" Width="650px" Height="600" ToolTip="A" ImageUrl='<%# Page.ResolveUrl(string.Format("~/Cli/{0}", Eval("image"))) %>' /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> </asp:Content> <asp:Content ID="Content4" ContentPlaceHolderID="cp_Button" Runat="Server"> <asp:Button ID ="btnRefresh" runat="server" onclick="btnRefresh_Click" Height="34" Width="110" Text="More Images" /> </asp:Content> Hi updated code :- Now on click event whole pages is refreshed. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; namespace EProxy { public class EventProxy : Control, IPostBackEventHandler { public EventProxy() { } public void RaisePostBackEvent(string eventArgument) { } public event EventHandler<EventArgs> EventProxied; protected virtual void OnEventProxy(EventArgs e) { if (this.EventProxied != null) { this.EventProxied(this, e); } } public void ProxyEvent(EventArgs e) { OnEventProxy(e); } } } On Master Page Code (btn click):- protected void btnRefresh_Click(object sender, EventArgs e) { ContentPlaceHolder cph = (ContentPlaceHolder)this.FindControl("MainContent"); EventProxy eventProxy = (EventProxy)cph.FindControl("ProxyControl") as EventProxy; eventProxy.ProxyEvent(e); } Web Config :- <pages maintainScrollPositionOnPostBack="true" enableViewStateMac="true"> <controls> <add tagPrefix="it" namespace="EProxy" assembly="App_Code"/> </controls> </pages>

    Read the article

  • Centering contentplaceholders

    - by gh9
    I have a contentplaceholder which needs to be centered (as close to absolute as possible) to the center of the page. The issue I am having is when, the browser moves to different resolutions the centering is thrown off. I have tried using divs and tables. I have switched out the precent with em units, and still no workie. Any help would be greatly appreciated. My end goal is to have the contentplaceholder always be in the center of page regardless of the resolution of the monitor <div style="width:20%"/> <div style="width:60"> contentplaceholercode </div> <div style="width:20%"/> <table> <tr > <td style="width:20%"> </td> <td style="width:60> </td> <td style="width:20%"> </td> </tr> </table> code for master and code for content page <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="WorkRecordr.Master" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <script src="Assets/Scripts/Jqeury1.4.4.js" type="text/javascript"></script> <title></title> <style type="text/css"> body { background-color: #326598; } .outer { width: 100%; border: solid 1px gray; padding: 1px; } .inner { border: solid 1px gray; width: 70%; margin-left: auto; margin-right: auto; } </style> </head> <body> <div style="text-align: center"> <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> </div> <form id="form1" runat="server"> <div class="outer"> <div class="inner"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </div> </form> </body> </html> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="WorkRecordr.test" MasterPageFile="~/Master.Master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> aaaaaaaaa***aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa***aaaaaaaaaaaaaaaa </asp:Content>

    Read the article

  • Error with masterpage

    - by Raphyboy
    Hi, i'm creating a brand new masterpage with VS2010 Beta 2 and I get this warning (that causes me errors in the content pages): Validation (XHTML 1.0 Transitional): Content is not supported outside 'script' or 'asp:content' regions. The masterpage's code : <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Bob.master.cs" Inherits="TShirtFactory.Web.All.Core.lib.masterpage.Bob" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </form> </body> </html> As you can see, it's the default masterpage generated code. I get the warning when I hover the tag at top. Does anybody have an idea of what's going on ? Thank you

    Read the article

  • JavaScript Intellisense with Telerik in ASP.NET Master Page Project with VS 2010

    - by Otto Neff
    Today I was looking for a solution to get finally the JScript/Javascript/jQuery Intellisense Featureworking with my ASP.Net Webform Project to work. I found some good articles: - JScript IntelliSense Overview- JScript IntelliSense: A Reference for the “Reference” Tag- Enabling JavaScript intellisense in VS.NET 2010 to work with SharePoint 2010- Rich IntelliSense for jQueryBUT, all of suggested solutions did not work right with my Master Page based Visual Studio 2010 Solution.Only with physical Javascript Files (Telerik includes certain Javascript Files like jQuery as Ressource) or/andconfigure always a new ASP.NET Scriptmanager / RadScriptManager on every page derived from the Master Page, wasn't exactly what I was looking for. So I came up with the following simple Solution, to Trick VS2010and still have the Project running with multiple runat="server" Scriptmanagers. In short:- New ASP.NET control derived from ScriptManager with emtpy overwritten OnInit() to use it as emtpy wrapper for VS2010. In detail:New RadScriptManager Classusing System; using System.Collections.Generic; using System.Linq; using System.Web; using Telerik.Web.UI; namespace IntellisenseJavascript.Controls { public class IntelliJS : RadScriptManager { protected override void OnInit(EventArgs e) { } protected override void OnPreRender(EventArgs e) { } protected override void OnLoad(EventArgs e) { } protected override void Render(System.Web.UI.HtmlTextWriter writer) { } public override void RenderControl(System.Web.UI.HtmlTextWriter writer) { } } } web.config<configuration> ... <system.web> ... <pages> <controls> <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/> <add tagPrefix="VSFix" namespace="IntellisenseJavascript.Controls" assembly="IntellisenseJavascript"/> </controls> </pages> ... Master Page<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="IntellisenseJavascript.Site" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html > <head id="head" runat="server"> <title></title> <telerik:RadStyleSheetManager ID="radStyleSheetManager" runat="server" /> </head> <body> <form id="form" runat="server"> <telerik:RadScriptManager ID="radScriptManager" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="radAjaxManager" runat="server"> </telerik:RadAjaxManager> <div> #MASTER CONTENT# <asp:ContentPlaceHolder ID="contentPlaceHolder" runat="server"> </asp:ContentPlaceHolder> </div> </form> <script type="text/javascript"> $(function () { // Masterpage ready $('body').css('margin', '50px'); }); </script> </body> </html> ASPX Page<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="IntellisenseJavascript.Default" %> <asp:Content ID="Content1" ContentPlaceHolderID="contentPlaceHolder" runat="server"> <VSFix:IntelliJS runat="server" ID="intelliJS"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </VSFix:IntelliJS> <div style="border: 5px solid #FF9900;"> #PAGE CONTENT# </div> <script type="text/javascript"> $(function () { // Page ready $('body').css('border', '5px solid #888'); }); </script> </asp:Content> The Result I know, this is not the way it meant to be... but now at least you can have a Main ScriptManager for all Common Scripts and Settings, inject page specific Javascripts in PageLoad Event in normal ASPX Files and have JavaScript Intellisense for defined Scripts from JS Files or Assembly Ressouce in your Content Maybe, vNext will fix this.

    Read the article

  • ASP.NET make a panel visible on click of hyperlink (whilst also cuasing postback for page navigation

    - by Helen
    I may be asking the impossible but let me set out my problem: I have a menu in a MasterPage which uses images and mouseover mouseout events for design purposes. On one of the menu options I need to display a set of sub menus options on the click of the parent menu item. The menu item itself also needs to navigate to a specified url. I was originally trying to use an AJAX accordion panel but as I only had one accordion panel it was always displaying the sub menu items and was not collapsing. I have also tried putting the options in a div and setting the display via javascript. This worked but then was overwritten once the page navigation postback occurred. Here is the source: <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%@ Register Src="LeadHeader.ascx" TagName="LeadHeader" TagPrefix="uc1" %> <%@ Register Src="~/LeadFooter.ascx" TagName="LeadFooter" TagPrefix="uc2" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> var revert = new Array(); var inames = new Array('home', 'whoweare', 'whatwedo','ourapproach', 'ourvalues', 'contact'); // Preload if (document.images) { var flipped = new Array(); for(i=0; i< inames.length; i++) { flipped[i] = new Image(); flipped[i].src = "images/"+inames[i]+"2.jpg"; } } function over(num) { if(document.images) { revert[num] = document.images[inames[num]].src; document.images[inames[num]].src = flipped[num].src; } } function out(num) { if(document.images) document.images[inames[num]].src = revert[num]; } function ShowHide(elementId) { var element = document.getElementById(elementId); if(element.style.display != "block") { element.style.display = "block"; } else { element.style.display = "none"; } } function UpdateText(element) { if(element.innerHTML.indexOf("Show") != -1) { element.innerHTML = "Hide Details"; } else { element.innerHTML = "Show Details"; } } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"> <uc1:LeadHeader ID="LeadHeader" runat="server" /> </asp:ContentPlaceHolder> <div id="nav"> <div class="menu-item"> <a href="Default.aspx"> <img src="Images/home.jpg" alt="home" id="home" onmouseover="over(0)" onmouseout="out(0)" class="right" /></a> </div> <div class="menu-item"> <a href="AboutUs.aspx"> <img src="Images/whoweare.jpg" alt="who we are" id="whoweare" onmouseover="over(1)" onmouseout="out(1)" class="right" /></a> </div> <%-- <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <cc1:Accordion ID="Accordion1" runat="server" AutoSize="None" FadeTransitions="true" TransitionDuration="350" FramesPerSecond="40" RequireOpenedPane="false" > <Panes> <cc1:AccordionPane runat="server"> <Header>--%> <div class="menu-item"> <a href="WhatWeDo.aspx"> <img src="Images/whatwedo.jpg" alt="what we do" id="whatwedo" onmouseover="over(2)" onmouseout="out(2)" class="right" onclick="ShowHide('divDetails');UpdateText(this);" /></a></div> <%--/Header> <Content>--%> <div id="divDetails" style="display:none;"> <a href="management.aspx" title="Management Development">Management Development</a><br /> <a href="leadership.aspx" title="Leadership Development">Leadership Development</a><br /> <a href="personal.aspx" title="Personal Development">Personal Development</a><br /> <a href="realteams.aspx" title="Team Building / Facilitation">Team Building & Facilitation</a><br /> <a href="coaching.aspx" title="Coaching">One to One Coaching</a> </div> <%-- </Content> </cc1:AccordionPane> </Panes> </cc1:Accordion> --%> <div class="menu-item"> <a href="OurApproach.aspx"> <img src="images/ourapproach.jpg" alt="our approach" id="ourapproach" onmouseover="over(3)" onmouseout="out(3)" /></a> </div> <div class="menu-item"> <a href="OurValues.aspx"> <img src="images/ourvalues.jpg" alt="our values" id="ourvalues" onmouseover="over(4)" onmouseout="out(4)" /></a> </div> <div class="menu-item"> <a href="ContactUs.aspx"> <img src="images/ContactUs.jpg" alt="contact us" id="contactus" onmouseover="over(5)" onmouseout="out(5)" /></a> </div> </div> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="ContentPlaceHolder3" runat="server"> <uc2:LeadFooter ID="LeadFooter" runat="server" /> </asp:ContentPlaceHolder> </div> </form> </body> </html>

    Read the article

  • Jquery-UI tabs : Double loading of the default tab

    - by Stephane
    I use jqueryui-tabs to display a tabbed UI. here is how my markup looks in a MasterPage: <div id="channel-tabs" class="ui-tabs"> <ul class="ui-tabs-nav"> <li><%=Html.ActionLink("Blogs", "Index", "Blog", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, new{ title="Blog Results" }) %></li> <li><%=Html.ActionLink("Forums", "Index", "Forums", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, null) %></li> <li><%=Html.ActionLink("Twitter", "Index", "Twitter", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, null) %></li> </ul> <div id="Blog_Results"> <asp:ContentPlaceHolder ID="ResultPlaceHolder" runat="server"> </asp:ContentPlaceHolder> </div> If the content is loaded via ajax, I return a partial view with the content of the tab. If the content is loaded directly, I load a page that include the content in the ContentPlaceHolder. somewhat like this : <asp:Content ID="Content2" ContentPlaceHolderID="BlogPlaceHolder" runat="server"> <%=Html.Partial("Partial",Model) %> </asp:Content> //same goes for the other tabs. With this in place, if I access the url "/Forums" It loads the forum content in the Blog tab first, trigger the ajax load of the Blog tab and replace the content with the blog content. I tried putting a different placeholder for each tab, but that didn't fix everything either, since when loading "/Forums" it will sure load the forum tab, but the Blog tab will show up first. Furthermore, when using separate placeholders, If I load the "/Blogs" url, It will first load the content statically in the Blog contentplaceholder and then trigger an ajax call to load it a second time and replace it. If I just link the tab to the hashtag, then when loading the forum tabs, I won't get the blog content... How would you achieve the expected behaviour? I feel like I might have a deeper probelm in the organization of my views. Is putting the tabs in the masterpage the way to go? Maybe I should just hijax the links manually and not rely on jquery-ui tabs to do the work for me. I cannot load all tabs by default and display them using the hash tags, I need an ajax loading because it is a search process that can be long. So to sum up : /Forum should load the forum tab, and let the other tabs be loaded with an ajax call when clicking on it. /Twitter should load the twitter tab and let the other tabs.... the same goes for /Blogs and any tabs I would add later. Any idea to have this working properly?

    Read the article

  • Accessing Content Page elements

    - by Abdel Olakara
    Hi all, I am facing a strange problem.. may be i am overlooking something and not able to find the silly issue. Need your help! I have a Master page and a Content Page: <form id="AccountForm" runat="server"> <div> <asp:ContentPlaceHolder ID="MenuHolder" runat="server"> </asp:ContentPlaceHolder> </div> <hr /> <div> <asp:ContentPlaceHolder ID="ContentHolder" runat="server"> </asp:ContentPlaceHolder> </div> And my content page has some form elements: <asp:Content ID="Content3" ContentPlaceHolderID="ContentHolder" runat="server"> First Name: <asp:TextBox ID="fName" runat="server"></asp:TextBox> <br /> Middle Name: <asp:TextBox ID="mName" runat="server"></asp:TextBox> <br /> Family Name: <asp:TextBox ID="lName" runat="server"></asp:TextBox> <br /> Birthday: <asp:TextBox ID="birthday" runat="server"></asp:TextBox> <br /> Mobile Phone: <asp:TextBox ID="mobile" runat="server"></asp:TextBox> <br /> Alternate Phone: <asp:TextBox ID="phone" runat="server"></asp:TextBox> <br /> I also have the code for submit button in the content page where i try to retrieve the values from the form elements and persist it into DB. Here is the SubmitButton_Click code: protected void SubmitButton_Click(object sender, EventArgs e) { log.Info("From Submit button: " + customerObject.first_name + " " + customerObject.family_name); if (fName != null) log.Info("First Name is not null"); log.Info("First Name:" + fName.Text); log.Info("Middle Name:" + mName.Text); log.Info("Family Name:" + fName.Text); log.Info("Mobile:" + mobile.Text); log.Info("Phone: " + phone.Text); log.Info("Address:" + bAddressL1.Text + bAddressL2.Text); Strangly.. i don't get any data that is filled into my text fields? Their objects are not null as well!! why is this behaviour happening? I am not trying to access elements in master page or other.. all the fields are in the content page.. only thing is there is no form element in the content page and the form element is in master page! Thanks in advance for your suggestions and answers. Abdel Raoof Olakara

    Read the article

  • locate label on content page

    - by VictorS
    I am trying to locate a label on a content page from within User Control(ascx) Page p = this.Page; //this line causes application to unload with no exception ContentPlaceHolder cp = (ContentPlaceHolder)p.Master.FindControl("Content2"); Label label = (Label)cp.FindControl("SomeLabel"); It just unloads itself with no exception mesage. Why does it happen?

    Read the article

1 2 3 4 5  | Next Page >