1
votes

Is it possible that i can i place a check in my module code seeing where my module is installed. (contentpane or rightpane or leftpane).

Basically if it is installed in the left or right pane i want to bring only 3 records to the display in my gridview and if it is installed in contentpane i want to bring all the records to the display in my gridview. is it possible? maybe can someone share any different technique by which i can achieve the above scenario in my module code.

2) how can i get the module id by only modulename in my c# code?

3

3 Answers

2
votes

You have a variety of options that I think would be better than having the module try to figure out what pane it is in:

  1. You add a setting where admins could specify the number of records to display
  2. You could do the above and add a Pager to it so users could get to additional records
  3. You could make your module a fixed height and set overflow:hidden or auto so users could scroll within the module.
2
votes

You are looking for

PortalModuleBase.ModuleConfiguration.PaneName

Building a module in this way will couple it very tightly to a specific skin. ContentPane is the only pane name that is sure to exist. Skinners can make up any other pane names as they see fit.

1
votes

[2] In your module, you can directly access ModuleID because the base class PortalModuleBase is already having that value.

and for 2 I am not sure but you can do me.parent.parent in debug mode because me.parent will be a container control and it's parent will be the pane. Casting it to pane may get it's name.

I don't know standard method to get that.