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.0re: NavigateURL() FUNCTIONre: NavigateURL() FUNCTION
Previous
 
Next
New Post
3/29/2008 8:36 AM
 

Hi All,

    I have used a usercontrol which has a datagrid and an edit link in it.What i want is to redirect to a user control in another module when clicked on the edit link which has the following url for ex:

http://localhost/sample4.7/User/tabid/55/ctl/EditUserCompetency/mid/371/UserCompetencyId/1/Default.aspx

This is the url i want the redirect to happen. Since UserCompetencyId is obtained from the database and i also want the module id which is being obtained from the database since i will specify to which module the redirect should happen in the settings of the module from where the redirect will happen.can anybody say how can i do this.I can't use editurl since i wnt the moduleid to be changed because i will be redirecting to a control in another module. or else can i overwrite a moduleid in the editurl based on the value obtained from the database.

Thanks,

Sandeep.M

 

   

 
New Post
3/29/2008 11:07 AM
 

hope you have got it let me make it more clear

i have a datagrid in an ascx file and this is what the edit link contains in the grid

 

<

 

asp:HyperLink runat ="server" id="AddColumnDefault15" ImageUrl="~/images/add.gif" NavigateUrl ='<% #NavigateURL(UserTabID,"EditUserCompetency") %>'

/> now the UserTabID is the one to which the module should be redirected by clicking on the edit link.Also theres a moduleid selected in the settings of the file along with the tabid.I mean to which module on that tab(page) the redirect should happen. say i need to redirect to the following url

 

http://localhost/sample4.7/User/tabid/55/ctl/EditUserCompetency/mid/371/UserCompetencyId/1/Default.aspx  This is the edit control of another module.

Now say the above links modulename is usermanager and the one i specified above this is the lists module from the lists i need to redirect to the edit control of the usermanager module based on the usercompetencyid.This usercompetencyid is obtained from the db i was able to bind the selected moduleid like below

<

asp:HyperLink runat ="server" id="AddColumnDefault15" ImageUrl="~/images/add.gif" NavigateUrl ='<% #NavigateURL(UserTabID,"EditUserCompetency","mid=" & UserModuleId) %>' />

 

 so the control and moduleid came.Now i need to pass the usercompetencyid also as a parameter which is obtained from the db along it .How can i do it?

please help its urgent

Thanks,

Sandeep., 

 
New Post
3/31/2008 10:03 PM
 

Sandeep,

I’m not 100% sure I understand your question/problem. But I’ll try and answer what I think you’re asking. You have a datagrid and you would like a hyperlink to open a control in a different module on a different page, and pass a parameter too?

Well, just looking at the little bit of code in your post you could try

<asp:HyperLink runat ="server" id="AddColumnDefault15" ImageUrl="~/images/add.gif" NavigateUrl ='<% #NavigateURL(UserTabID,"EditUserCompetency","mid=" & UserModuleId & “,UserCompetencyId=” & usercompentencyid) %>' />

I was under the impression that you need to use <asp:HyperLinkColumn> in a datagrid… but if your link is working so far the above changes might work. With the NavigateURL() function if you want to pass multiple query string parameters you can just keep adding them to your list and DotNetNuke will parse them out.

For example in the link:

http://localhost/sample4.7/User/tabid/55/ctl/EditUserCompetency/mid/371/UserCompetencyId/1/Default.aspx

there are actually 4 query string parameter sets:

tabid = 55                                    --This is the page ID
ctl = ‘EditUserCompetency’     --This is the control key (same as the ‘key’ of the control in the module definitions)
mid = 371                                    --This is the module ID
UserCompetency = 1                --This is your custom query string

So, in NavigateURL() you can just keep adding key=value sets separated by commas and DotNetNuke will turn them into key/value/.

Another thing to keep in mind is that if you redistribute the module or install it on a different DNN box, the TabID of your target page won’t necessarily be the same. I don’t know how you’re setting the value of UserTabID but if you’re hard coding it you’ll have some headaches when/if you redistribute. I recommend an admin setting where you can specify the TabID. You can also search for the TabID by name but if there are two pages with the same name or if someone changes the name of you target page it will break the link.

I have a lot more experience doing this with gridview, and can post some gridview examples of using NavigateURL()  for hyperlink columns, image buttons, and gridview commands, if your interested. Let me know if you have any other questions.

Nathan Rover

 
New Post
4/7/2008 10:23 AM
 

Hi Nathan,

          Thanks for your help i have solved the iisue and for your information i have not hardcoded anything and this redirection will happen based on admin settings onlY.And i also have not used any tab names which are fixed.I have given a combo which displays all the tabs in the site and on selecting the tab another combo shows the modules on it and then this will be updated by the admin.so i hope there will be no problem.

Thanks once again for your answer.

Regards,

Sandeep.M

 
New Post
5/27/2011 3:47 PM
 
hi nathan
i saw u r solution for giving link to one item in data grid but when i try to do that it giving me error can you help me for this see my error below
Error: is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: i:\Development\Code\SHBLI\DesktopModules\ImageGallery\ImageGalleryList.ascx(42): error CS1061: '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 be found (are you missing a using directive or an assembly reference?) ---> System.Web.HttpCompileException: i:\Development\Code\SHBLI\DesktopModules\ImageGallery\ImageGalleryList.ascx(42): error CS1061: '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 be found (are you missing a using directive or an assembly reference?) at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc) at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0re: NavigateURL() FUNCTIONre: NavigateURL() FUNCTION


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