CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 3/25/2007 1:19:42 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 51 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
rypki
Asp.Net User
Can't set theme and title using OnPreInit method3/25/2007 1:19:42 PM

0/0

Hi,

I have several aspx pages. For some of them I have removed from Page directive attributes Theme and Title. The page is called Lazur.aspx. My code behind looks like this:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Lazur : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected override void OnPreInit(EventArgs e)
    {
        base.OnPreInit(e);
        Theme = "Lazur";
Title = "Home"
    }

}

 I can't set theme using this code. Theme Lazur is in App_Themes folder, it contains Lazur.css and Lazur.skin files. However I see number of errors in my Lazur.aspx file: on error list I see:

Error 1 Validation (): Element 'html' occurs too few times. G:\Documents and Settings\bartek\Moje dokumenty\Visual Studio 2005\WebSites\WebSite1\Lazur.aspx 8 14 G:\...\WebSite1\
Error 2 Unrecognized tag prefix or device filter 'asp'. G:\Documents and Settings\bartek\Moje dokumenty\Visual Studio 2005\WebSites\WebSite1\Lazur.aspx 2 2 G:\...\WebSite1\

But before I removed the attributes Title and Theme everything worked fine. Now it doesn't.

Did anyone experience simmilar problem??

Thanks for help in advance.

rypki

albertpascual
Asp.Net User
Re: Can't set theme and title using OnPreInit method3/25/2007 3:32:44 PM

0/0

Should work, but just for testing porposes, did you try to set the theme on the web.config?
Cheers
Al

My Blog
Please click on 'Mark as Answer' if this post answered your question!
rypki
Asp.Net User
Re: Can't set theme and title using OnPreInit method3/27/2007 2:47:55 PM

0/0

I did and it works, but I still can't set theme programmaticaly. I have setted the breakpoints at the Page_Load method and OnPreInit method. When I run the application I can see the message that appears next breakpoints: ("The breakpoint would not currently be hit. No symbols has been loaded for this document." Maybe something is wrong with my classes. Maybe I should construct one class for all pages and derive from it whenever I construct new page. What do you think?
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Microsoft Visual C# 2005 Unleashed Authors: Kevin Hoffman, Pages: 692, Published: 2006

Web:
Can't set theme and title using OnPreInit method - ASP.NET Forums Can't set theme and title using OnPreInit method. Last post 04-02-2007 9:49 PM by Zhao Ji Ma - MSFT. 3 replies. Sort Posts: ...
Carl J » Dynamically Applying Themes To Your ASP.Net Site With A ... What are the different ways that you can specify and change the themes in an ASP ... through code doesn’t give you any advantages over the previous methods. ...
Specifying the Master Page Programmatically : The Official ... Alternatively, you can override the Page class's OnPreInit method and set ..... you don't need to bind it to a master page because the master page is set ...
Sharepoint - Lessons learned Take a look at the OnPreInit(..) method above again. We can't set the .... Page Change HTTPModule /// Can eg. be used to change the theme according to time ...
HoneyCMS .NET 2.0 Blog: Foundation Work II If the theme change event did not occur then the pages them Id is set to the Cultures theme Id. The BasePage class override of the OnPreInit method also ...
Master Pages :: Specifying the Master Page Programmatically ... OnPreInit method. To set the master page programmatically, then, we can either ... (BasePage) back in the Specifying the Title, Meta Tags, and Other HTML ...
Inside Microsoft: Styling a Site using Themes Now, using themes, you can not only apply a CSS style sheet file to all pages in a site by ..... Page Protected Overrides Sub OnPreInit(ByVal e As System. ...
Nested Master Pages The base-class then overrides the page's "OnPreInit" method and uses this property to set the Page object's MasterPageFile at runtime: ...
Web Applications Development using Microsoft ASP.NET However, it overrides the base Page class's OnPreInit() method and adds the logic ... When using Visual Web Developer, you can create a new Theme folder by ...
Dinesh’s Blog OnPreInit - The OnPreInit method is called at the beginning of the page .... Write(view[i]["Title"].ToString() + “ “);. The only limitation of using a ...




Search This Site:










custom error pages not working on iis

filenotfoundexception error ocuring randomly

convert dnn to work through a webservice

user permission to edit,create,view

viewing internal .net class code

step by step migrating from classic asp to asp.net 1.1

3.0.11 - failed to load install template - error

access to the path " " is denied.

accessing the contentplaceholder through c#

updating with sqldatasource ??

an error has occurred writing to the exception log

how to change to use stored procedure

rendercontents not working

advanced problem - word automation through my website

dumb question about namespaces

application blocks

how about a control to set view permissions that encapsulates the duallist control?

login form

progress bar

custom control for selecting time on a page..need a direction from someone..

friend software not so friendly

catalogzone property: close (problem)

copying dll's to another folder

installing visual studio.net 2005 team suite for developers

pictures website

treeview

strange "expected ;" error

error in a new web appliction

*urgent* - access is denied problem with asp.net 1.1 application

using layers for website layout

 
All Times Are GMT