473,413 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Create Custom Default.ASPX

We are using ASP.2.0 and I was wondering if any one knew how I could modify
the default.aspx.

What I want to do is add some new HTML to the aspx page as well as either
change the code behind or use some new code beside on the page itself.

For example, I want to change this
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>

To

<%@ Page Language="C#" AutoEventWireup="true" UICulture="auto"
Culture="auto" CodeFile="Default.aspx.cs" Inherits="_Default" %>

I also was hoping to add some custom code to the page by default ie:

protected override void InitializeCulture(){

string CurrentCulture ="";

try{

CurrentCulture = Session["Culture"].ToString();

if (CurrentCulture.Length > 0){

Thread.CurrentThread.CurrentUICulture = new
CultureInfo(CurrentCulture);

Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(CurrentCulture);

ErrorMessage = "Language: " + CurrentCulture;

}

}

catch (Exception ex) {

ErrorMessage = ex.Message.ToString();

}
}

I am not interested in the master page solution as it is not a viable
approach for our solution.

Thanks in advance

Sanjay
Nov 19 '05 #1
2 1352
You'd have to change the template files. This was fairly easy before for
non-web projects, but for the new web model these are the only files I can
find:

C:\Program Files\Microsoft Visual Studio 8\Web\WebNewFileItems\CSharp

So change these template files and see if that gives you what you need.

-Brock
DevelopMentor
http://staff.develop.com/ballen
We are using ASP.2.0 and I was wondering if any one knew how I could
modify the default.aspx.

What I want to do is add some new HTML to the aspx page as well as
either change the code behind or use some new code beside on the page
itself.

For example, I want to change this
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
To

<%@ Page Language="C#" AutoEventWireup="true" UICulture="auto"
Culture="auto" CodeFile="Default.aspx.cs" Inherits="_Default" %>

I also was hoping to add some custom code to the page by default ie:

protected override void InitializeCulture(){

string CurrentCulture ="";

try{

CurrentCulture = Session["Culture"].ToString();

if (CurrentCulture.Length > 0){

Thread.CurrentThread.CurrentUICulture = new
CultureInfo(CurrentCulture);

Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(CurrentCulture);

ErrorMessage = "Language: " + CurrentCulture;

}

}

catch (Exception ex) {

ErrorMessage = ex.Message.ToString();

}

}

I am not interested in the master page solution as it is not a viable
approach for our solution.

Thanks in advance

Sanjay


Nov 19 '05 #2
Hello,

I don't know how to do it in 2.0 but in 1.x you can create your own custom
templates. It's a bit of a process but well worth the effort to not have to
customize each page as you know.

Here is the article I used to create all of mine.

http://msdn.microsoft.com/library/de...stomwebwiz.asp

HTH
--
Ian Lane
"Sanjay Pais" wrote:
We are using ASP.2.0 and I was wondering if any one knew how I could modify
the default.aspx.

What I want to do is add some new HTML to the aspx page as well as either
change the code behind or use some new code beside on the page itself.

For example, I want to change this
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>

To

<%@ Page Language="C#" AutoEventWireup="true" UICulture="auto"
Culture="auto" CodeFile="Default.aspx.cs" Inherits="_Default" %>

I also was hoping to add some custom code to the page by default ie:

protected override void InitializeCulture(){

string CurrentCulture ="";

try{

CurrentCulture = Session["Culture"].ToString();

if (CurrentCulture.Length > 0){

Thread.CurrentThread.CurrentUICulture = new
CultureInfo(CurrentCulture);

Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(CurrentCulture);

ErrorMessage = "Language: " + CurrentCulture;

}

}

catch (Exception ex) {

ErrorMessage = ex.Message.ToString();

}
}

I am not interested in the master page solution as it is not a viable
approach for our solution.

Thanks in advance

Sanjay

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lloyd Dupont | last post by:
I'm trying to create a templated custom control which hold a collection of something else in his property 'Panels' when this property is of type ArrayList it parse ok. however when I try to use...
6
by: John Lau | last post by:
Hi, I am looking at the MS KB Article 306355: HOW TO: Create Custom Error Reporting Pages in ASP.NET by Using Visual C# .NET This article describes how to redirect errors to a custom html...
3
by: Ranginald | last post by:
Hey, I'm trying to create a simple class to create a textbox, and then instantiate it from a page (so I can resue it across an asp.net app). I've been scratching my head but I can't get this to...
5
by: moondaddy | last post by:
I want to create a custom UI element which will be a custom rectangle object in a c# XAML application. I'm new to XAML and c# as most of my experience has been using vb with sql. I'm building a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.