Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

DotNetNuke Marketplace
  Ads  
 


  Sponsors  

Meet Our Sponsors

SmarterTools
Verndale
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  re: NavigateURL() FUNCTION
Previous Previous
 
Next Next
New Post 3/29/2008 6:36 AM
Resolved
User is offline sandeep
65 posts
10th Ranked


re: NavigateURL() FUNCTION 

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 9:07 AM
User is offline sandeep
65 posts
10th Ranked


Re: re: NavigateURL() FUNCTION 

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 8:03 PM
User is offline Nathan Rover
39 posts
www.websitemakers.com
10th Ranked


Re: re: NavigateURL() FUNCTION 

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 8:23 AM
User is offline sandeep
65 posts
10th Ranked


Re: re: NavigateURL() FUNCTION 

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

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  re: NavigateURL() FUNCTION
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


AppTheory
Professional development for medium to large projects based on the DotNetNuke platform.
www.apptheory.com
OnyakTech
Modules for Help Desks, Live Chat, Project Management, CRM, Charting, Reporting, Scrolling Text/Images, Portal Community tools and much more.
www.OnyakTech.com
IHostASP.NET Provides the Ideal DNN Hosting
We will help you with the installation, configuration, and troubleshooting of your DNN portal, no task is too big or small for us. Unlike other companies we are not just providing a reliable hosting service, but we are also focused on providing the best DotNetNuke hosting service on the internet.
www.ihostasp.net

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP