468,539 Members | 1,693 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,539 developers. It's quick & easy.

2 design pages using the same code-behind file and class


I' using ASP.net 2.0. I have 2 design pages, which are the same, but in
2 languages. Is it possible to use only one code-behind page for both
these pages bcoz, the code and logic and everthing else is the same and
I've taken care about the messages and other small differences in the
code. I've given the same Id for the web controls on both pages.
On the @page directive, I'm using the same file and class in the
'codefile' and 'inherits' attributes.
Everything seemed to work fine without any problem but,when I tried to
include 2 user controls for the header and footer section of the pages,
I started having problems. The compiler sometimes gives an error
message saying that the 'classname in the code-behind file is
ambiguous'. This error doesn't come all the time, but only some
times.Some times the error is 'Type 'user control' not defined'. when I
remove the user controls, and use include files in their place,
everything seems to work.

I don't want to use localization for some reasons.
Is what I'm doing is ok or is there any other way of handling this?

This is the @page directive I've used on both index.aspx and
ar-index.aspx file. I removed the ar-index.aspx.vb file and code is
only in index.aspx.vb as class index.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="index.aspx.vb"
Inherits="index" %>

Can somebody pl. help? Thank you.


Sep 24 '06 #1
0 920

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

43 posts views Thread by grz02 | last post: by
reply views Thread by grz02 | last post: by
reply views Thread by Lefevre, Steven | last post: by
3 posts views Thread by Rushikesh | last post: by
5 posts views Thread by Wescotte | last post: by
1 post views Thread by Stewart Rogers | last post: by
2 posts views Thread by tomhawkins1 | last post: by
1 post views Thread by jason | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.