Click here to Skip to main content
15,886,518 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to read/write data from another website onto your webpage? Pin
Not Active26-Sep-09 13:16
mentorNot Active26-Sep-09 13:16 
AnswerRe: How to read/write data from another website onto your webpage? Pin
Abhijit Jana26-Sep-09 13:17
professionalAbhijit Jana26-Sep-09 13:17 
QuestionRendering and Viewing Source in ASP.NET Pin
MarkMokris26-Sep-09 6:24
MarkMokris26-Sep-09 6:24 
AnswerRe: Rendering and Viewing Source in ASP.NET Pin
Abhishek Sur26-Sep-09 6:34
professionalAbhishek Sur26-Sep-09 6:34 
QuestionSharing same code-behind between multiple aspx pages Pin
tfaol26-Sep-09 3:01
tfaol26-Sep-09 3:01 
AnswerRe: Sharing same code-behind between multiple aspx pages Pin
Abhijit Jana26-Sep-09 3:10
professionalAbhijit Jana26-Sep-09 3:10 
AnswerRe: Sharing same code-behind between multiple aspx pages Pin
Abhishek Sur26-Sep-09 6:08
professionalAbhishek Sur26-Sep-09 6:08 
QuestionRe: Sharing same code-behind between multiple aspx pages [modified] Pin
tfaol27-Sep-09 2:09
tfaol27-Sep-09 2:09 
Thank you all Smile | :)

sorry if my question is not clear enough. |:

To be more detailed:

In our project, we have a business and data layers. Each has a class with related methods and properties that can be accessed by any web form within the project.

What we're working on is:

Develop a bilingual system, create 2 pages for the same purpose but with different UI language. we're looking for using the same code-behind file for both of them but with a little difference which is in a Button Click event called "Back" that specify different 'Redirect' link.

we tried the the 2 methods mentioned above.

In the 1st option we considered one of the 2 pages class, which has all needed methods and properties in code-behind, as a base class of the other one, which has no methods.

e.g.
Project called: MyProject
page 1 called: Page_1.aspx
page 2 called: Page_2.aspx
Page_1.aspx.cs is a base class,
Page_2.aspx has the following page directive:

<%@ Page Title="" Language="C#" MasterPageFile="MasterPage.Master" AutoEventWireup="true" CodeBehind="Page_2.aspx.cs" Inherits="Page_1.MyProject" %>

Now, I need to know which option is the best in our case?


One more question:

while using the 2ed option, create a base class, we need to define some aspx page controls within the code to be accessed by any methods in the base class. we faced a problem when tring to declare them as a class data member?!

Note: we use a master page, so the controls in aspx pages are placed in a content holder
and because of this we use the following declaration statement:

Label Label1 = (Label)this.Master.FindControl("ContentPlaceHolder1").FindControl("Label1");

the error occured when using 'this': "keyword 'this' is not available in the current context"

any suggestions please?


Thanks again. <=

modified on Sunday, September 27, 2009 8:38 AM

AnswerRe: Sharing same code-behind between multiple aspx pages Pin
Nicolas Muniere14-Mar-10 8:11
Nicolas Muniere14-Mar-10 8:11 
AnswerRe: Sharing same code-behind between multiple aspx pages Pin
tfaol14-Mar-10 23:39
tfaol14-Mar-10 23:39 
QuestionDeclaring variable globally Pin
srikantha_nagaraj26-Sep-09 2:42
srikantha_nagaraj26-Sep-09 2:42 
AnswerRe: Declaring variable globally Pin
Abhijit Jana26-Sep-09 2:58
professionalAbhijit Jana26-Sep-09 2:58 
GeneralRe: Declaring variable globally Pin
srikantha_nagaraj26-Sep-09 22:43
srikantha_nagaraj26-Sep-09 22:43 
GeneralRe: Declaring variable globally Pin
Abhijit Jana26-Sep-09 22:50
professionalAbhijit Jana26-Sep-09 22:50 
GeneralRe: Declaring variable globally Pin
srikantha_nagaraj26-Sep-09 23:05
srikantha_nagaraj26-Sep-09 23:05 
GeneralRe: Declaring variable globally Pin
Abhijit Jana26-Sep-09 23:16
professionalAbhijit Jana26-Sep-09 23:16 
AnswerRe: Declaring variable globally Pin
Abhishek Sur26-Sep-09 6:13
professionalAbhishek Sur26-Sep-09 6:13 
GeneralRe: Declaring variable globally Pin
Not Active26-Sep-09 13:24
mentorNot Active26-Sep-09 13:24 
GeneralRe: Declaring variable globally Pin
Abhishek Sur27-Sep-09 8:32
professionalAbhishek Sur27-Sep-09 8:32 
GeneralRe: Declaring variable globally Pin
srikantha_nagaraj26-Sep-09 22:50
srikantha_nagaraj26-Sep-09 22:50 
GeneralRe: Declaring variable globally Pin
Abhijit Jana26-Sep-09 23:07
professionalAbhijit Jana26-Sep-09 23:07 
GeneralRe: Declaring variable globally Pin
Abhishek Sur28-Sep-09 6:46
professionalAbhishek Sur28-Sep-09 6:46 
Questionpage not opening Pin
ais0725-Sep-09 23:37
ais0725-Sep-09 23:37 
AnswerRe: page not opening Pin
Christian Graus25-Sep-09 23:53
protectorChristian Graus25-Sep-09 23:53 
GeneralRe: page not opening Pin
ais0726-Sep-09 0:07
ais0726-Sep-09 0:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.