Help converting ASP Resource to ASP.NET

Can some help me convert this ASP Resource to ASP.NET?

We're on the verge of upgrading to 9.5 but don't want to lose this functionality.

It puts the HP Management Homepage on the node details page.

JB

  • JB,

    We too have number of custom ASP resources that need to be converted. Some are very simple, and others are quite extensive and complex. I have yet to crack the code required to make them work now that the ASP proxy has been removed from 9.5, but if I figure it out, I'll certainly circle back around to this post again.

    Wish I could help... :(

  • Sure. I attached an asp.net version. Hopefully this will be helpful to others with resources to convert. Note: I added ".txt" to the end of the filename to make the forum happy. The proper file name should be "HPManagementHomePage.ascx". ASP.NET resources must have a .ascx extension.

    I should also point out that this resource is simple enough that you don't really need to bother with code at all. The Custom HTML Resource can do this job just fine. Add a Custom HTML Resource to your view, then click its EDIT button and enter this text:

            <table width="100%">
                <tr>
                    <td colspan="4">
                        <table border="0" cellpadding="2" cellspacing="0" width="100%">
                            <tr>
                                <td class="Property" width="10"> </td>
                                <td class="PropertyHeader">HP Management Homepage</td>
                                <td class="Property"> </td>
                                <td class="Property"><a href="https://${IP_Address}:2381" target="_blank">https://${IP_Address}:2381</a> </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

    The "${IP_Address}" macros will get replaced with the IP Address of the current node. This will work just fine in any version of Orion.

  • Thanks!

    I also thought that this was too simple so I created a new Resource for my HP Servers and added it to that.  Here's snipit of the code...

     <tr>
       <td class="Property" width="10"> </td>
       <td class="PropertyHeader">Management Homepage</td>
       <td class="Property"> </td>
       <td class="Property"><a href="https://<%#Eval("IPAddress")%>:2381" Target="_blank">https://<%#Eval("IPAddress")%>:2381</a> </td>
     </tr>

    JB

  • Tim- thanks for the input. Just to clarify:

    The old *.Resource files that were the classic ASP files must now be *.ascx files.

    Also, I assume as before they go in the respective location with respect to the type of view that they will be added to (summary, node details, etc)? -> .\Inetpub\SolarWindsNPM\Orion\NetPerfMon\Resources\*******

  • Yes, that's right. Actually, in your path (.\Inetpub\SolarWindsNPM\Orion\NetPerfMon\Resources\*******) the "*******" doesn't affect what type of view they go in. That's controlled by the "RequiredInterfaces" property in the code for the resource. The "*******" directory just controls what group they go in on the Add Resource to View page.

  • One last (and EXTREMELY complicated) question about the new .NET resources.

    We used a classic ASP resource and several static tables in the database to create a sort of system inventory that was tied to each node- it just displayed some simple stats such as CPU type, Memory installed, etc. Being that my .NET knowledge accounts to about zero, I'm stabbing in the dark here.

    With the classic ASP, the 'NetPerfMon.NewSQLResource' was used a ton...and I'm at a loss as to how to replicate that functionality. I can't find a similar function- I assume it's all embeded in the DLLs or somewhere else. While I'm sure it would be possible to set up a new connection to the DB simply to read some static data, I figured it would be easier to use something like the NewSQLResource...is there such a thing?

    Thanks!

  • jrutski,
    Good to see you're still around...

    This is one of my biggest questions as well.

  • Here's a very basic sample of running a SQL query and displaying it as a table in the resource. In this example, I'm taking advantage of the automatic databinding of ASP.NET's DataGrid control. The columns to display are determined by whatever columns are returned by the SQL query.

  • Here's a fancier version. This gets rid of the DataGrid with automatic databinding and replaces it with an ASP.NET Repeater control. This control requires you to specify all of your HTML explicitly, but the benefit is that you get more control. I used that control to make the node names links to their Node Details pages with full support for the Toolset right-click menu and the new 9.5 node details popups.