Popular searches

Searching for master page



  • HeadermanagerControl - step 1 master page
    This example is what you get in the download. I will try to guide you though it so you get an understanding of the control. We have a master page - master.master - and two pages (page1.aspx and page2.aspx). Now - lets start with master.master: <%@ Master Language="C#" AutoEventWir
  • Master pages in ASP - free template engine
    We are here gonna create a three page website - all pages should use a "template" for layout. This will enable us to easily keep a consistent layout for all our pages and also, it sure brings  structure to your code. I have used this technique for 5 years or so, one lar...
  • Master pages, themes and url rewriting
    When you are using themes, the ASP.NET engine will automatically create <link href="App_Themes/themename/css/yourcss.css" type="text/css" rel="stylesheet" /> tags for each css file placed in (or under) the active theme directory. If you at the same time a...
  • Step 2 - page1.aspx
    es (may it be javascript or css) is only included ONCE per page. We also redefine the keywords metatag. This will override the value defined in the master page - but the description will be taken from (since it is not overridden in this page). Here we include a stylesheet as well: <hea
  • No viewstate at all
    object LoadPageStateFromPersistenceMedium() { return null; } Please note that you need to do it in the pages - not the master page! These functions are more typically used to alter the way (or medium) viewstate is save to/from - but by just doing nothing at all we n
  • Step 2: Test case - control your Javascript
    This testcase (solution is downloadable - in related article) is really simple and basic. Master pages is used. The master page contains a single contentplaceholder Untitled Page Step 1: The problem
    es debugging and readability to keep them together. This "<script>-all-around-the-html" thing sure is true if you are using master pages and different aspx files should include different js files. 2. While GetResourceUrl and the automatic AXD handler makes it easy t
  • Visual Studio 2005 Web Application Project
    me manually tweaks for debugging to work etc.  I tried to convert  this site - which is a fairly small project (around 10 aspx pages), master pages is used, a few third party components and a separate BLL/DAL. I did have some trouble at first - some pages didn't get converte
  • Download the asp.net javascript logging console
    is pretty much explained here   I instead want to talk about how you can use it: 1. Add a reference to jslogcontrol.dll 2. Add it to your master page or to whatever page you want to use the console on. <%@ Register TagPrefix="jslog" Namespace="JSLogControl" Assembly="JSLogControl
  • ASP.NET and Ajax urlrewriting
    first - it's a lot of web.config changes with httpmodules etc, however I think it would be worth it. It works in all scenarios, such as master pages and ajax callbacks etc . While the docs are pretty decent - it's often easiest to see other installations (so download the Sampl
  • Selecting random items from array
    plement random link rolling. The used a third party CMS so all I could do (well considering the time parameter as well) was to change the ASP.NET master page to include some quick link selection code as well. So therefore this code might look very hardcoded - I mean a "real" solution would
  • Step 4: Using the JavaScriptServe control (and download solution)
    Lets now use the control we created in step 3  : Apart from referencing the javascriptserve.dll we just set page1.aspx too look like this: <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="page1.aspx.cs" Inherits="page1" Titl...
  • Step 3 - page2.aspx
    In this page we are using two controls (just to show you it's possible). <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="page2.aspx.cs" Inherits="page2" Title="Untitled Page" %> <%@ Register TagPrefix="headermanager" Namespace="ASPCodeHeaderM...
  • The Google Analytics ASP.NET webcontrol
    This is a really simple webcontrol - injecting the google analytics code into your page(s). I won't explain much, but rather show you the use of it: 1. add a reference to the GoogleAnalyticsCtrl dll. 2. Declare the use of it from your aspx page: <%@ Register TagPrefix="analytics" Na...
  • Page-level caching, or passing data between different ascx:s
    Since building up a webpage from many different ascx-files is a very good idea instead of building the pages totally in the aspx-file you soon come up with the need of communication between the different ascx-pages. In other words, you need the exact same data strucure used in one ascx file in anot...
  • Using ASP scripts from HTM pages
    1. What does he mean? Well I guess that's what you must be asking yourself - and I really have to agree the title looks kind of cryptic. I understand I'd better motivate you to keep reading, so I do my best: Imagine you have this site and you have a Latest news-function where news headlines are ...
  • System.Web.UI.Page.RegisterStartupScript(string,string) is obsolete
    I bet you use the RegisterStartupScript a lot - in conjunction with IsClientScriptBlockRegistered it is an easy way to insert a chunk of Javascript code into your ASP.NET page. if ( !Page.IsStartupScriptRegistered("mytest") ) Page.RegisterStartupScript("...
  • The JQuery specifics
    As you might have noticed I am totally hooked on JQuery . As a Javascript library it's fantastic and I have therefore decided to use it for Ajax functionality as well.   For my experimental project http://www.findfreefonts.net I decided to use it and therefore this ASPCodeHeaderMa...
  • System.Web.UI.Page.RegisterClientScriptBlock(string, string) is obsolete
    The power of injecting JavaScript into your ASP.NET pages from your codebehind code is really important, considering that the controls client ID:s will not be the same as in your designtime ASPX file. In ASP.NET 1.1 it was pretty easy to inject JavaScript by using this code ...
  • Configuration
    You don’t need to make any changes at all to get it running, just browse to http://localhost/picmentor and it should show startpage. However there are some tweaks you might want to do and you control that through the web.config file:      <add key="Theme"...
  • ASP.NET search terms to database and listing most popular
    Logging search terms your visitors are using at your site can be valuable for you as a webmaster, first of all just knowing what they are looking for at your site but also it can give you a hint if some of your content seems hard to reach by "regular" navigation making people always needing to...
  • Syndicate your articles with JavaScript
    Note: the examples here and download solution are created using C# and ASP.NET 2.0, but if you are using .NET 1.1 - read on cause the basic ideas are pretty much the same. Changed 2006-09-27: added instructions at the bottom if you get no results at your own system While ...
  • Last second HTML changes in your ASP.NET page
    While this solution might seems a little odd (or more correctly the problem might seem very odd) but this technique has sure solved a lot of problems for me. What I'm gonna show you is a was to manipulate the resulting HTML and ASP.NET page has generated just before it's sent to the browse...
  • Ajax.NET part 3
    Here we continue our Ajax.NET exploring adventures started  here and in part 2 . One thing I havn't talked about yet is the code we put in Page_Load: protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default)); } ...
  • Your first ASP.NET script with Ajax
    This is just a very basic example on how to deliver Ajax functionality from your ASP.NET applications. The downloadable solution contains two code files - but lets start with looking at the screenshots: The idea is we should be able to just click the "Refresh time belo...
  • Codebehind databinding - howto part 2
    In part 1   we created a gridview and programatically fed it with a stored procedure resultset from SQL Server.  Now lets see what happens when the visitor clicks the Edit link or New Customer link. The NavigateUrl was set to editcust.aspx in our gri...
  • BLL next step - howto part 7
    Now, in this part of the " In practice " serie - lets look more into our movement from ASPX pages directly consuming datasets and datatables into using classes in a sort of business layer. While the code for the customer was pretty straigtforward, we do get some interesting pro...
  • Including WebResource in ASP.NET server control
    Embedding resources (such as images, javascript, stylesheet information) into your server control makes it a lot easier for redistribution - and reusing the control in other projects is indeed the reason as why to create a control at all. This example will show you how to embed a javascript ...
  • ASP.NET Server control with JavaScript
    This is a tip: if your ASP.NET server control is supposed to use some JavaScript it's very easy to just add it inside your (automaticlly created RenderContents function) protected override void RenderContents(HtmlTextWriter output) { if (Page.ClientScript.IsClientScriptBlo...
  • ASP.NET and JQuery - updating templated controls with AJAH
    Continuing our serie on JQuery and ASP.NET we are now gonna create an interface looking like this: When selecting a filter we want to spawn an Ajax request and update only the table part of the interface: So far we have used ASHX handlers and returned JSON structures cont...
  • My view of VS2005
    This article was written some months ago but not published until 2006-06-02.     Being somwehat "slow" I have not until a few months ago developed and delivered my first whole project in VS 2005. As you all know it's not until you create a "real" project you...
  • Screenscraping with HttpWebRequest
    While I bet you all know how to (from your own webpage) read another webpage, even located on another site/server, so while I will show you the code for it, I also want to show you a very practical use of it. Background As you might have seen I have created a new layout for thi...
  • Javascript include from ASP.NET server control
    In ASP.NET 2.0 the Page object has a Header property - which contains a Controls collection. This is good news since it makes it possible  to (easily) inject a <script type="text/javascript" src="whatever"> into the <head></head>...
  • Creating an ASHX handler in ASP.NET
    Today a typical web application is not only about serving HTML to browsers, but also serving XML and other types of content. Say you are creating a RSS feed for your site, for example. RSS should be presented as XML and I will cover that specific case in another article (will be available in rela...
  • Dynamically select CSS in ASP.NET
    By setting a control in your ASPX page  to runat="server" you make the control available to serverside modifications. While you most often use it for pure asp.net server controls, such as <asp:TextBox ...>, <asp:Label ...> etc you can in fact use it for other elemen...
  • ASP.NET 301 redirect
    When moving your pages from one place to another it is very tempting to handle old inlinks by creating a simple Response.Redirect( sNewPage, true ); This sure will work, but this type of redirect is a 302 and is meant for temporary relocations of pages. But your pages are permanentl...
  • Get current page name
    This function can be used to retrieve the current page:s name, i.e default.aspx, hello.aspx or whatever. public string GetCurrentPageName() { string sPath = System.Web.HttpContext.Current.Request.Url.AbsolutePath; System.IO.FileInfo oInfo = new System.IO.FileInfo(sPath); stri...
  • Step 3: Render to page header
    As explained in step 2 we want to render the script src tags into the page:s <header> part. And be able to do it from wothin the specific page:s contentplaceholders.   I have developed a control for that - JSIncludeControl and it uses some of the techniques described...
  • Accessible Ajax calls 2 solving history problem
    The importance of accessibility has become more and more in focus as Ajax solution becomes more and more spread. I have talked a lot of the need for it in this article on Accessible Ajax calls   and while it certainly could be argued the solution might be a little "raw" an...
  • Securing pages with login scripts
    These functions can be used on certain pages you want password protected. First create a file called includelogin.asp with this content: <% Response . Buffer = True Function ValidateLogin ( sId , sPwd ) ' For you to validate ID and PASSWORD ' M...
  • Accessible Ajax calls 3 history and Ajax calls
    Now in the downloadable solution look at default.aspx. I have the next/prev  hyperlinks call the PostbackAndSetHistory js function which doesn't do much: function PostbackAndSetHistory(controlid, controlvalue) { ASPCode.net.History.setLocation( c...
  • How Ajax for ASP.NET updatepanels work
    I will now try to show you the different types of updates you can do - cause there is indeed a plethora of them and the variations really got me confused today. I started working on this sample http://ajax.asp.net/docs/mref/M_System_Web_UI_ScriptManager_RegisterAsyncPostBackControl_1...
  • Accessible Ajax calls
    Say a paging scenario. You have a repeater and shows the pages one by one and also you have some sort of "pager". Personally I never use the built in paging mechanism for say the gridviews - simple because it needs a postback. Which means the pages after the first one&...
  • Use NetSpell in your ASP.NET 2.0 application
    This simple beginners tutorial will show you how to start using the free spellchecking component NetSpell from Loresoft from within your ASP.NET 2.0 application. When you download it http://sourceforge.net/projects/netspell/ you will see there is a full featured ASP.NET forms examp...
  • AdMentor.NET features
    3.01 MySQL is now supported. Look in the directory otherdatabases and you will find two table creation scripts, one for MySQL and one for SQL Server. Please note that the binary release is compiled with ASP.NET 1.1 and therefore you/your host needs to have that installed. AdMentor.NET uses My...
  • Background
    Recommentor lets you setup a recommend-a-page on your site. Main features are: 1. Easily used from any page of your site. Just place a link to yourserver.com/recommentor/default.asp and it automatically makes use of the current page 2. Usage with a lot of different email components. See doc...
  • ASP.NET, MySQL and paging
    In this article we will create a simple one page ASP.NET web application, implementing paging using the cool MySQL feature LIMIT and SQL_CALC_FOUND_ROWS. One of the coolest things about MySQL is some of its non standard features. It might sound like a weird thing to say, but being a web develo...
  • A simple login mechanism instead of built-in Forms Authentication
    While ASP.NET certainly do give us developers a pretty nice security/login model sometimes I feel a little frustrated when wanting to implement it. I mean in theory it's as simple as: 1. Define a few lines in web.config 2. Create a login.aspx page But at least for me, I seem to never be able to ...
  • Built-in Forms Authentication - sample with DOWNLOAD
    We want to implement a login solution to all files in directory /admin/. All other pages should be public. Lets look at the filestructure in Visual Studio: The webroot default.aspx page looks like this: As you can see we can surf to that page with no trouble. When trying to access /admin...
  • JSDropdownlist - part 1, outlining the problem
    This is part 1 in a article series on creating a "JSDropdownlist" - a dropdownlist for solving problem with bloated GUI:s. For a customer I created an application which started out with a really nice and clean GUI. A datagrid was filled with records and one of the columns was a &...
Searching for master page