Click here to Skip to main content
16,010,650 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionis this heathy Pin
aziz_subaie10-Aug-07 0:08
aziz_subaie10-Aug-07 0:08 
AnswerRe: is this heathy Pin
rahul.net1110-Aug-07 0:52
rahul.net1110-Aug-07 0:52 
GeneralRe: is this heathy Pin
aziz_subaie10-Aug-07 1:17
aziz_subaie10-Aug-07 1:17 
GeneralRe: is this heathy Pin
rahul.net1110-Aug-07 2:33
rahul.net1110-Aug-07 2:33 
GeneralRe: is this heathy Pin
aziz_subaie10-Aug-07 3:15
aziz_subaie10-Aug-07 3:15 
AnswerRe: is this heathy Pin
N a v a n e e t h10-Aug-07 1:05
N a v a n e e t h10-Aug-07 1:05 
GeneralRe: is this heathy Pin
aziz_subaie10-Aug-07 1:19
aziz_subaie10-Aug-07 1:19 
GeneralRe: is this heathy Pin
N a v a n e e t h12-Aug-07 18:28
N a v a n e e t h12-Aug-07 18:28 
aziz_subaie wrote:
can you give me an idea about the base class please


Well, by default as you see ASP.NET page will be inherited from System.Web.UI.Page. This is the base class which has properties needed for page initialization. But if you want to have some additional functionalities for all your pages, you can create a custom base class that inherits from Page and your ASP.NET page inherits from your custom class.

Assume you have created a base class called CAuthentication. It could be some thing like

class CAuthentication:System.Web.UI.Page
{
    private void override OnLoad(object sender,EventArgs e)
    {
       base.OnLoad(e);
       //Check your session and redirect here
    }
}

Let's look into your ASPX.CS page.

class MyPage:CAuthentication
{
    protected void Page_Load()
    {
        //Do your page load. This will happen only after session authenticated in CAuthentication class
    }
}

When you run your page, CAuthetication will be invoked first and do your session checking. So this will help you to avoid rewriting session checking function in all of your pages. This base class can also be useful for extending Page class functionalities.


Questioncrystal reports Pin
raj@code9-Aug-07 23:56
raj@code9-Aug-07 23:56 
AnswerRe: crystal reports Pin
codelinks10-Aug-07 0:13
codelinks10-Aug-07 0:13 
AnswerRe: crystal reports Pin
codelinks10-Aug-07 0:16
codelinks10-Aug-07 0:16 
AnswerRe: crystal reports Pin
Malcolm Smart10-Aug-07 2:34
Malcolm Smart10-Aug-07 2:34 
Questiontreeview [modified] Pin
Nidhiii9-Aug-07 23:45
Nidhiii9-Aug-07 23:45 
AnswerRe: treeview Pin
Blue_Boy10-Aug-07 0:05
Blue_Boy10-Aug-07 0:05 
QuestionCSS dilemma Pin
matjame9-Aug-07 23:33
matjame9-Aug-07 23:33 
AnswerRe: CSS dilemma Pin
N a v a n e e t h9-Aug-07 23:38
N a v a n e e t h9-Aug-07 23:38 
AnswerRe: CSS dilemma Pin
Pete O'Hanlon9-Aug-07 23:39
mvePete O'Hanlon9-Aug-07 23:39 
AnswerRe: CSS dilemma Pin
Talal Sultan10-Aug-07 0:08
Talal Sultan10-Aug-07 0:08 
QuestionCould not establish Database connection Pin
IamAmit9-Aug-07 23:12
IamAmit9-Aug-07 23:12 
AnswerRe: Could not establish Database connection Pin
Michael Sync9-Aug-07 23:59
Michael Sync9-Aug-07 23:59 
GeneralRe: Could not establish Database connection Pin
IamAmit10-Aug-07 0:26
IamAmit10-Aug-07 0:26 
GeneralRe: Could not establish Database connection Pin
Michael Sync10-Aug-07 5:53
Michael Sync10-Aug-07 5:53 
Questionparse xml from string variable not from file Pin
deepalititi9-Aug-07 23:07
deepalititi9-Aug-07 23:07 
QuestionHow to refresh asp.net page without getting blank Pin
Ratnadeep_Raul9-Aug-07 23:00
Ratnadeep_Raul9-Aug-07 23:00 
AnswerRe: How to refresh asp.net page without getting blank Pin
Talal Sultan9-Aug-07 23:07
Talal Sultan9-Aug-07 23: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.