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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Code to Redirect to Edit ProfileCode to Redirect to Edit Profile
Previous
 
Next
New Post
11/17/2011 4:16 AM
 

Hi all,

I'm new to DNN. i have a custom module in which i would like to put an link to profile edit. Is there any way that i can do that? 

this is the current solutions that i have tried.

<asp:HyperLink ID="HyperLink1" runat="server"
            NavigateUrl = "[AS:URL:EDITPROFILE]" > Edit Profile |
            </asp:HyperLink> 
but its not working.

Here is the other one:

ModuleController mc = new ModuleController();
                ModuleInfo mi = mc.GetModuleByDefinition(PortalId, "User Accounts");
                HyperLink1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Edit", "mid=" + mi.ModuleID.ToString(), "UserID=" + UserId.ToString());

this code work only for admin/host users only.

 
New Post
11/20/2011 9:37 AM
 

hi KLOB1100

try some thing like this below

<asp:HyperLink ID="hycatid" runat="server" NavigateUrl='<%#getLink(DataBinder.Eval(Container.DataItem,"ID").ToString()) %> '>
<%# DataBinder.Eval(Container.DataItem,"Name") %>
</asp:HyperLink>


C# code:

public string getLink(string ID)
        {
            string str = (Globals.NavigateURL(PortalSettings.ActiveTab.TabID,"Edit","mid="+ModuleID, "ID=" + ID)).ToString();
          
            return str;
        }

 
New Post
11/20/2011 8:06 PM
 
hi ghouse

thanks for your reply. I have tried your code. it did not work since code "Container.DateItem" give me an error that says:System.Web.UI.Control does not contain a definition for DataItem and no extension method 'DataItem' accepting a first argument of type System.Web.UI.Control could not be found (are you missing a directive or an assembly reference?).
 
New Post
11/20/2011 8:10 PM
 
Hi All,

I think i have found a solution, i tried to trace on the module files for User Profile and found this code to link to Edit Profile..

On Page Load method:

HyperLink1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + UserId, "pageno=3");
Search.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Search Program", "mid=" + ModuleId.ToString());
 
New Post
11/23/2011 5:52 AM
 

try this.

<asp:HyperLink ID="hycatid" runat="server" NavigateUrl='<%#getLink(DataBinder.Eval(Container.DataItem,"ID").ToString()) %> '>
Name
</asp:HyperLink>


C# code:

public string getLink(string ID)
        {
            string str = (Globals.NavigateURL(PortalSettings.ActiveTab.TabID,"Edit","mid="+ModuleID, "ID=" + ID)).ToString();
          
            return str;
        }


Actually that container.Dataitem is for datagrid. u can use any of your control or just title

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Code to Redirect to Edit ProfileCode to Redirect to Edit Profile


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