Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to pass values through user controls of a module?How to pass values through user controls of a module?
Previous
 
Next
New Post
2/29/2008 8:03 AM
 

Hello there,

I have one module with 2 user controls. To change from one usercontrol to another, I do this:

ModuleController objModules = new ModuleController();
Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Key", "mid=" + ModuleId.ToString()));

But, I don't want to only change user controls. I want to change to the other user control and pass values to it. How can I do that?

Please, note that I program in C# so, probably only examples in that language would be helpful.

Thanks in advance,

Kau.

 
New Post
2/29/2008 9:46 AM
 

use:
 NavigateURL(PortalSettings.ActiveTab.TabID, key, "mid=" & ModuleId.ToString, KeyName & "=" & KeyValue) ,

where <Keyname> is the key you want to use to retrieve your value. (example: "RecordID" & "=" & value)

in the Page_load of the module you want to retrieve the values use :

Request.QueryString(<Keyname>) to retrieve your value

BR

Jutta Ipsen

 
New Post
2/29/2008 9:49 AM
 

Hi Kau,

If your extra parameters are simple and do not require any security, you can just append them to the additionalParameters parameter of the NavigateURL call as follows:

Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Key", string.Format("mid={0}&myparameter={1}", ModuleId.ToString(), myvalue)

Remember that this value will be displayed in the user's browser and will be directly modifyable, so only use this approach if security isn't an issue.

There are other approaches, but this is by far the quickest.

Hope this helps!

Brandon

EDIT: I'm not on a system with DNN on it, so I can't verify -- the additionalParameters may be a string array, and not a simple string.  As such, one may need to modify the code I listed above to reflect the actual parameter type.


Brandon Haynes
BrandonHaynes.org
 
New Post
2/29/2008 4:02 PM
 

 

Hi Brandon

I have tried this in the ModuleActions method where I wanted the selected value of a drop down box to be transferred to another module. It doss not work since this method is fired before Page_Load so the selctedValue is empty. I have only been able make this work in hyperlinks where I call the NavigateUrl method in a selfmade method in my call-behind file.

Do you see another solution ?

Paul S

 
New Post
2/29/2008 6:27 PM
 

Hi Paul,

I would try to set the value <asp:DropDownList  .... AutoPostBack="True"   ..</asp:DropDownList> . This will trigger a postback whenever the DropDownList's selected item is changed .You can then save the value in a hidden field....Then it should be there fore ModuleAction method.

BR

Jutta Ipsen 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to pass values through user controls of a module?How to pass values through user controls of a module?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out