Thanks Jon, almost there, but there is one thing more.
I put the underneath line in my click event (when user clicks on A record, which also fires imc event)
DotNetNuke.UI.Utilities.DNNClientAPI.set_MinMaxContentVisibile(this, ModuleId, false, DotNetNuke.UI.Utilities.DNNClientAPI.MinMaxPersistanceType.Cookie, false);
what happens is that, indeed the search module collapses to minimize state (thats good ). But after user clicks on a other page (for example Home) and comes back on the page with these two modules, the search module is still collapsed (and that's not the intention, when antering page, maximized, when searched, minimized). Oke understandable, the cookie is set and it does what it is supposed to do. So I thought why not putting the reverse of collapsing in the onclick event in !IsPostback in the pageload of the search module (can you still follow me?).
This is what I've done to try this, unfortunately this ain't working. Can you, or anyone else help me with this one ?
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Communications;
using DotNetNuke.UI.Containers;
namespace MyCompany.Visibility
{
/// <summary>
/// Summary description for Search.
/// </summary>
public class Search : PortalModuleBase, IModuleCommunicator
{
protected System.Web.UI.WebControls.TextBox txtValue2Send;
protected System.Web.UI.WebControls.Button bntTriggerImc;
public event DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventHandler ModuleCommunication;
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
DotNetNuke.UI.Utilities.DNNClientAPI.set_MinMaxContentVisibile(this, ModuleId, true,
DotNetNuke.UI.Utilities.DNNClientAPI.MinMaxPersistanceType.Cookie, true);
}
}
#region Web Form Designer generated code
private void bntTriggerImc_Click(object sender, System.EventArgs e)
{
DotNetNuke.UI.Utilities.DNNClientAPI.set_MinMaxContentVisibile(this, ModuleId, false,
DotNetNuke.UI.Utilities.DNNClientAPI.MinMaxPersistanceType.Cookie, false);
ModuleCommunicationEventArgs oArgs = new ModuleCommunicationEventArgs();
oArgs.Text = txtValue2Send.Text;
oArgs.Sender = "SenderSearc";
oArgs.Target = "TargetDetail";
if(ModuleCommunication != null)
{
ModuleCommunication(this, oArgs);
}
}
}