This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

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

Parents Reply
  • FormerMember
    0 FormerMember in reply to tdanner

    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\*******

Children
  • 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.

  • FormerMember
    0 FormerMember in reply to tdanner

    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.

  • FormerMember
    0 FormerMember in reply to tdanner

    While I really need to remember my C syntax...THIS IS AWESOME! Tim- Thanks a TON!!! Very Much appreciated!

  • I was afraid the old .resource files would go away.  I did something special where I took the code from the interface details Min/Max/Average bps In/Out resource and put it in the Current Percent Utilization of Each Interface resource so that we could click a single link and get a current graph of each interface. 

    It ended up working beautifully for some of the veiws we wanted.  I thought I looked at the .Net code for it but it was much more complicated.  I think I got lucky with the other.  I was hoping SW would add that as an option sometime.

    Here is the file...

  • Tim,

    Thanks for sharing this. I'll have to play around with this a little and see if I can figure out how to expand on it. Also, for some reason I can't open the simple example. It just shows up as blank for me... :(

    One of the biggest benefits to Orion is the ability to customize the website, and even though you guys are not responsible for customizations implemented by your customers, it's good to see that you are willing to offer tidbits of info that allow us to better understand what we need to do to keep up with the changes in the base product. :)

  • Also, for some reason I can't open the simple example. It just shows up as blank for me... :(

    Had to save it to my machine locally and then I could open it.. :/

  • ecornwall,

    It sounds like you built a resource that you can stick on a Node Details view and get one chart for each interface on that node. Is that right?

    I whipped up something like that (attached). It could be a lot fancier, but this gives you a basic one-chart-per-interface resource in a fairly small amount of code. This uses some of the techniques I used earlier in this thread: an ASP.NET Repeater control for a dealing with a sequence of items and the "CurrentNode" snippet.

    The new stuff in this one: calling GetInterfaces() on the node to get a list of interfaces that can be bound to the Repeater, and building an <img> tag in the body of the Repeater. I took the URL for the image tag by copying the URL of the kind of chart I wanted, finding the spot in the URL that had the interface id (looks like "I:683") and replacing it with <%# Eval("NetObjectID") %>, which will get substituted for the current interface by the Repeater control.