IIS7 - Making IIS7 Manager UI Extension development easier - a little VS trick

When I started developing IIS7 Manager UI Extension modules, it took a little longer time for me to create the entire form manually. Robert's post helped me to some extent. But, still it took a little bit of more time till I figured out this little trick which I'm going to explain.

IIS7 UI modules uses nothing but System.Windows.Forms namespace. The UI stuff would come from your class which should be derived from Microsoft.Web.Management.Client.Win32.ModulePage defined in the DLL. So, how to make your Visual Studio to give you the designer view for your ModulePage class development which would have all your UI elements, their position, their event handlers (button click for example), et al.

 

imageThis is how your class would define your class deriving from ModulePage, and having all declarations of all your UI elements.

Now, if you right click on the file (MyPage.cs in my example) in the solution explorer, you would have an option to get to the designer - "View Designer". Click on that option. Or you can just double click on the MyPage.cs in the solution explorer to directly taking you to the designer view. Now, you would see the below:

 

image

 

This tells you why it can't display it. Now, comes the interesting part how to make it shown in the designer view. Now, go back to the designer view and change your class (MyPage in my example) to be derived from System.Windows.Forms.Form like below:

 

imageNow you should be able to see the designer view for your Module UI if you go to the Designer view in your Visual Studio.

Now, VS thinks that it is a Windows Form and it displays all your UI elements in the designer view.

Cool isn't it? Now, I'm sure your development time would be very less. You can just develop your IIS7 UI modules just as you develop any Windows Application using Visual Studio. You can drag and drop any control you need. For example : Drag a button, just double click on a button to get its button click event handler created.

 

image

 

But, you need to make sure that before your build your project, change your class to be derived from Microsoft.Web.Management.Client.Win32.ModulePage. If you just build the class deriving from Form, then you might end up in getting errors while opening IIS manager to view that module you have written.

Useful Links:

  • Creating a Simple UI Module
  • Creating a Module Page for IIS7 Administration Tool
  • Adding Configuration Functionality to IIS7 Admin Tool Extensions
  • http://blogs.msdn.com/carlosag/archive/2006/08/12/ExtendingTreeView.aspx
  • Hope this helps!

    Published Wednesday, March 05, 2008 8:08 AM by rakkimk
    Filed under:

    Comments

    # re: IIS7 - Making IIS7 Manager UI Extension development easier - a little VS trick

    Wednesday, March 05, 2008 10:42 PM by Mfartura

    I'm using VS2005 and I dowloaded the sample code to create a new page Carlos provided on his post in June last year.  When I right click the samplepage.cs through the solution explorer, no "view design" option shows up.

    What am I missing here?

    # re: IIS7 - Making IIS7 Manager UI Extension development easier - a little VS trick

    Thursday, March 06, 2008 5:04 AM by ratanak phut

    i'm happhy come in website.

    # re: IIS7 - Making IIS7 Manager UI Extension development easier - a little VS trick

    Thursday, March 06, 2008 6:49 AM by rakkimk

    @ Mfartura

    You should have some class in your samplepage.cs which derives from Microsoft.Web.Management.Client.Win32.ModulePage or System.Windows.Forms.Form. Can you verify that?

    # re: IIS7 - Making IIS7 Manager UI Extension development easier - a little VS trick

    Thursday, March 06, 2008 6:49 AM by rakkimk

    @ ratanak

    Thanks for visiting!

    # IIS7 - Writing your first custom UI module with all winform controls

    You should follow this article on IIS.net to create your first “simple” IIS7 UI extension which would

    # IIS7 - Writing your first custom UI module with all winform controls

    Monday, June 09, 2008 9:00 PM by

    You should follow this article on IIS.net to create your first “simple” IIS7 UI extension which would

    # IIS7 - Writing your first custom UI module with all winform controls

    Monday, June 09, 2008 9:04 PM by rakkimk

    You should follow this article on IIS.net to create your first “simple” IIS7 UI extension which would

    Leave a Comment

    (required) 
    (required) 
    (optional)
    (required) 
    Powered by Community Server (Commercial Edition), by Telligent Systems