Create Custom Default.ASPX

S

Sanjay Pais

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
 
B

Brock Allen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top