master-pages

Accessing a control in asp.net content page through Javascript

Hi, I have a form in my content page for which I am doing some client side validations via Javascript. The Javascript behaves as expected if I place the JS code directly in the content page. But if I place the JS code in it's own file and try accessing that from the content/master page (through the script tag's src attribute), I get a r...

Call a method on browser closing

I am facing an issue in my application when a user directly clicked on browser close [X] button. Browser can be IE, Chrome, Mozilla, Firefox and many more. What I want to do: 1. as soon as user hits [X] button of browser, need to set their status as logged off in database for which we have a method in Login.aspx file which is within the...

asp:login form does not submit when you hit enter

I am having an issues while using the <asp:login> tag. When a user clicks the "login" button, the form will process correctly. However, when the user hits the enter key, the form self submits and does not process the login, whether it was correct information or not. I am using a combination of MasterPages, and Umbraco. My aspx code l...

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

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"...

Should view render menus or master pages

I've developed my own custom users and roles objects using ActiveRecord that do NOT extend the default Asp.Net providers and therefore I can't get the user from the HttpContext. I can create a custom htmlhelper to render menus but should my views render the menu or the master page? If it's the master page how can I pass to the custom h...

ASP.NET how to use __doPostBack from Custom JavaScript with Master/Content Pages

In a simple aspx page I can have a custom JavaScript function postback as described in http://www.xefteri.com/articles/show.cfm?id=18 The simple page uses a linkbutton: <asp:LinkButton id="CreateFile" runat="server" onclick="CreateFile_Click" /> with code behind that has the VB subroutine: Sub CreateFile_Click(ByVal sender As System....

How can I access master page text box from jquery file?

In my master page i've a textbox. <asp:TextBox ID="SearchTextBox" runat="server" class="searchtxtbox" onfocus="HideSearchWaterMark();" Text="Search" onblur="ShowSearchWaterMark(this);" /> I added jquery references in code behind. TextBox SearchTextBox = this.FindControl("SearchTextBox") as TextBox; StringBuilder objStrin...

Global content via Sharepoint Page Layouts or how to have default content?

Hello there, I have two page layouts: Homepage + Regular page. They both work together with a single masterpage. On both page layouts I show some kind of global link list: <a href=#">Link 1</a> <a href=#">Link 2</a> Is there some way to reference the fields on the homepage from all pages using the "regular" page layout? I would lik...

Asp.Net - UserControl - Inherit from MasterPage

Is it possible for an user control (ascx) to doing something like herit from a MasterPage ? My point is, in one of my user control (only use by one kind of MasterPage), I would like to use an <asp:content> tag, but I can't, I can only in the page that use that user control... So, I have to repeat some code into each of the page that us...

How do I access a DIV from javascript, if ASP.NET mangles its ID?

I have a web page that contains a "div" element. On the page, there is javascript to reference the div: document.getElementById('divId'). This was working fine until another developer redesigned the page to use an ASP master page. Now, document.getElementById('divId') returns null. It appears that ASP.net prepends some characters to ...

Does ASP.NET MVC require you to use master pages?

My group is working on a new web application and is considering using MVC. However, there are members who would rather include pages than use master pages. Is this possible to do in ASP.NET MVC? In the small amount of time that I've poked around with MVC I have not yet been able to figure out how one might accomplish that. ...

how to make the footer to stick exactly at the bottom of the page?

I'm using ASP.net Master page. I've a footer in my page. When content of my page is less, the footer is coming in the middle of the page. What do i need to do. please suggest. Thanks. ...

Master page popup login control using ajaxcontroltoolkit don't work

I made a pop control on the master page in asp.net 3.5 please see the following code: Main.master aspx code: <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Panel ID="Panel1" runat="server" style="display:none; background-color:White; width:700; border-width:2px; border...

Is it possible for a Master page to access Controller properties?

I need to load a HTML wrapper dynamically depending on data that gets populated in the PageController, which is a base class that all other controllers implement. This is the PageController: public class PageController : Controller { protected PageConfiguration PageConfiguration; public string WrapperTop { get; set; } publ...

upgrading SharePoint 2007 master page to SharePoint 2010

I am getting ready to upgrade a SharePoint 2007 Master page to a SharePoint 2010 master page. Does anyone have any experience doing this? I could use some suggestions on how to finish the upgrade smoothly. Thanks ...

how to disable controls of master page used in content page while processing some event in asp.net

The following code works fine for disabling content page controls, but how do I disable master page controls? public void DisableControls(Control control,bool isEnable) { if (control.HasControls()) { foreach (Control c in control.Controls) { DisableControls(c, isEnable); } } else {...

Conditional ContentPlaceHolder in Master Page

I have two master pages in my project, one for web views and another for emails. In the web master page is a placeholder to put page specific JavaScript, if a page is using this and I try to programmatically change the masterpage to send as an email the server falls over as it can't find the placeholder. Is there a way to change the beh...

Can I hide a user control in a master page from a content page?

How can I hide a user control on the master page from a content page? This is code I have on my content page's load. Dim banner As UserControl = DirectCast(Master.FindControl("uc_banner1"), UserControl) banner.Visible = True Does nothing for me :( ...

Master page different layouts

Hello all. Better to explain with the example. :) Let's say that I have two master pages (or more). The first master page have some plain layout with two content place holders and the second master page have more complex layout with four content place holders. When I am manually creating a page to use each of the master pages, VS will...

How to find the Web User Control (i.e. .ascx) used on the page layout in sharepoint site

Hi, I need the list of all the user controls(i.e. .ascx) used through out the site in sharepoint. This can be done in Site Content and Structure by selecting any page layout in the Master Page Gallery and by clicking on the Show Related Resources link. I want to know whether there is any sharepoint API available for this functionality...