master-pages

Can a ScriptReference be added to Master Page CompositeScript using markup?

I'd like to use the ScriptManager and CompositeScript components in my master page to include site-wide javascript, but add to that list in my "Web Content Form". I'm sure that can be done in the code-behind, but optimally I'd like to do it in markup. Can this sort of thing be done? In: MasterPage.master <asp:ScriptManager ID="ScriptMa...

How do I get ‘footer’ content on a master page to push down when main content doesn't fill a page

I have the following code for my masterpage: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www...

Overriding System.Web.Mvc.ViewMasterPage, where to make call to grab from cache?

Hi, I need to grab a value from the HttpCOntext.Items request cache, where should I do this? Is there a particular event or contsructor I should override? ...

Google search code in ASP.NET Master Page

I'm trying to put the following Google generated search box code into a Master page on a site: <form action="http://www.google.com/cse" id="cse-search-box"> <div> <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxx:u3qsil-l6ut" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <input type="text" name="q" siz...

Passing master page form data to another webform

I have a master page with one form on it. It is a search form which must always be visible. When the button of that form is clicked I want the form data to be sent to search.aspx. The problem is, I don't know how. I cannot set the form action to search.aspx, because all my other pages which use the master form will go to search.aspx. Thi...

ASP.NET MVC - View with master page, how to set title?

What is prefered way of setting html title (in head) for view when using master pages? One way is by using Page.Title in .aspx file, but that requires in master page which can mess with HTML code. So, lets assume no server side controls, only pure html. Any better ideas? UPDATE: I would like to set title in view NOT in the controller...

ASP.NET default button

I have a master page with a search box and button at the top. This search functionality is taking over the "enter" key for all my web forms that use this master page. That is, if I have a login page that uses this master page and the user enters in their username/password and hits "enter", instead of logging in the user the system perf...

I want a Master UserControl (a Master page, but for UserControls)

ASP.NET master pages - essential things. However, I have a lot of very similar UserControls in my projects - it might be a standard layout for an AJAX ModalPopup, or something more involved. I wish I could get rid of some of my duplicated code (both in ascx files and code-behind) with some Master UserControls. Does anyone have any sug...

How to Instantiate User control in Master page cs file

I have added uc in contentplace holder of master page but how do you instantiate the user control in master page .cs file to make it visible when the master page loads ...

ASP.NET Custom 404 Returning 200 OK Instead of 404 Not Found

After trying to setup my site for Google Webmaster Tools I found that my Custom ASP.NET 404 page was not returning the 404 status code. It displayed the correct custom page and told the browser that everything is OK. This is consider a soft 404 or false 404. Google doesn't like this. So I found many articles on the issue but the solution...

Really stupid ATM...why can't I reference Master.FindControl?

oPanel = CType(Master.FindControl("panelSearch"), Panel) This code resides on my masterpage's back-end (theMaster.master.vb), but I get a "Cannot refer to an instance member from within a shared class or shared member initializer without an explicit instance of the class" the function it resides in IS shared, I just can't remember for ...

Update links on master page with data from child page

I have a menu of report links in my master page. I need to append an ID to the end of each whenever the user changes a value on the child page. What's a good way to accomplish this? UPDATE: I should have mentioned that the child update is happening inside an UpdatePanel, meaning the master page is not reloaded when the change happens. ...

ViewState object lost in Master Page Load

I am assigning ViewState["something"] in Page Load of content page and when I try to access the ViewState variable in Master Page Load event handler, the viewstate variable is lost.Can anyone guide me why this is happening and the solution. ...

How to access a user control in a masterpage from a content page?

Lets say that I have a header user control in a master page, and want to change a property of the user control depending on what content page is loaded inside of the master page. How might I go about this? Thanks! ...

Master Pages and Postback in ASP.NET

How can we avoid Master Page from posting back the whole page? ...

I'm new to .NET - what should I concentrate on and what should I ignore?

So, I've had a fair amount of experience programming database driven web apps using php and coldfusion (not together, at different times) and I'm starting to look into the asp.net world (I have a project coming up at work that is all asp.net/c#.) My question is: there seems to be a lot of stuff to get mired in and if I'm just making web...

What's the best way to do javascript validation on ASP.Net page with Masterpage?

I am implementing Javascript Validation on an ASP.Net page that is inside a Master Page. The control IDs are changing, so I can't use the original control IDs for validation. I looked on the Net and got the suggestion to build the script dynamically, and add it to the page using RegisterStartupScript. I don't like that solution because i...

Do Ajax and ASP.NET MasterPages mix?

Has anyone had experience using these two technologies in tandem? What are (if any) the major difficulties in getting the two to cooperate? How would a site using these technologies be different than a normal ASP.NET Web Application with Ajax? Thanks! ...

How to reference a Master Page from a user control?

I'm looking for a way to (preferably) strongly type a master page from a user control which is found in a content page that uses the master page. Sadly, you can't use this in a user control: <%@ MasterType VirtualPath="~/Masters/Whatever.master" %> I'm trying to access a property of the master page from the user control and would rat...

ASP.NET Controller Base Class User.Identity.Name

Hi folks As described in this post, I created an abstract base controller class in order to be able to pass data from a controller to master.page. In this case, I want to lookup a user in my db, querying for User.Identity.Name (only if he is logged in). However, I noticed that in this abstract base class the User property is always nul...