Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Create Custom Default.ASPX

Reply
Thread Tools

Create Custom Default.ASPX

 
 
Sanjay Pais
Guest
Posts: n/a
 
      06-17-2005
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


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      06-17-2005
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
>




 
Reply With Quote
 
 
 
 
=?Utf-8?B?SWFuIExhbmU=?= .enizin.net>
Guest
Posts: n/a
 
      06-17-2005
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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Consuming Web Service from WIndows application when WebService is using Custom Service Account ( Create an Application Pool with a Custom Identity) DNB ASP .Net Security 1 01-22-2008 09:08 PM
Error Consuming Web Service from WIndows application when WebService is using Custom Service Account ( Create an Application Pool with a Custom Identity) DNB ASP .Net Web Services 1 01-20-2008 01:47 PM
How can i create new users without utilizing the create user wizar prady ASP .Net 2 12-29-2007 10:46 PM
Can I create a Create .NET 1.1 project in VS2005? JB ASP .Net 1 12-14-2007 10:53 AM
How to create python script which can create csv we file with relationship Sonu Python 1 08-03-2007 01:08 PM



Advertisments