cancel
Showing results for 
Search instead for 
Did you mean: 

Application_Error feature in .Net PDK

Former Member
0 Kudos

Hi,

I am working in .Net PDK 1.0 patch 3. Could anyone please tell me whether any feature similar to Application error in Global.asax in ASP .Net is available in .Net PDK so that on any application error, the user can be navigated to custom error page.

Thanks

Swetha

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Can you please tell me which folder you refer to in "[installation Directory]\Server0x\portalApps\ (next to the web.config file)" - in my solution or the path in server because I could find only a app.config file in .Net PDK solution and not a web.config file.

Also, what must I do to restart a runtime component and how do I create and associate a Global.asax to each component. I am sorry, could you please explain the process in detail?

Thanks

Swetha

Former Member
0 Kudos

Hi,

I will explain what happens in more details:

Unlike regular ASP.NET, the PDK.NET portal applications share the same hosting environment. The PDK.NET runtime component hosts all the portal applications. As a result they share the same global.asax file.

So you do not place the global.asax file in each portal application, like you would do in a regular asp.net web application.

The Global.asax file should be placed in the <b>runtime</b> installation folder: "[installation Directory]Server0xportalApps (next to the web.config file).

In order to restart the a runtime node just use the PDK MMC-sanpin (Start->Program Files->SAP Portal Runtime for Microsoft .NET->Management Console). For more details take a look at the following guide: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6807356c-0801-0010-7082-c00...

Regards,

Tsachi

Former Member
0 Kudos

Hi,

On any application error like "Sql server does not exist" or "connection failed" or any kind of network / database problems, I want the control to get transferred to a custom error page asking the user to contact customer support.

Thanks

Swetha

Former Member
0 Kudos

Hi,

There is some kind of workaround for this, that have NOT been tested, so use at your own risk.

Place a file called "Global.asax" in the following directory: [installation Directory]\Server0x\portalApps\ (next to the web.config file).

In it place the following:


<%@ Application Language="C#" %>

<script runat="server">

    void Application_Start(object sender, EventArgs e) 
    {
        // Code that runs on application startup

    }
    
    void Application_End(object sender, EventArgs e) 
    {
        //  Code that runs on application shutdown

    }
        
    void Application_Error(object sender, EventArgs e) 
    {
       \Do your coding here
    }

    void Session_Start(object sender, EventArgs e) 
    {
       
    }

    void Session_End(object sender, EventArgs e) 
    {
        
    }
       
</script>

Now restart the SAP .NET Runtime component.

This should be done foreach runtime node.

Regards,

Tsachi

Former Member
0 Kudos

Hi,

What would you like to do in the Application_Error method of the global asax file?