Developer forum

Forum » Development » gui.linkmanager

gui.linkmanager


Reply

Hi,




 




Can somebody help, Im trying to get the linkmanager to work.




 




Think im getting it wrong about the ref part...simply cant figure out what the IDs reffered to are, and how to retrieve them.




 




Thanks in advance




 




best regards




Regin Madsen


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Regin


 


If you are using VB.net you can just do like this:


Dynamicweb.Gui.LinkManager("Default.aspx?ID=12", "NameOfField")


It will produce a normal linkmanager with the ability to link to files, internal pages or by typing an absolute URL.


 


Because the method i our class has some optional parameteres not supported by C# you have to specify a little extra parameters in C#:


Dynamicweb.Gui.LinkManager("Default.aspx?ID=12", "NameOfField", False, False)


 


The first false indicates if it should be impossible to link to a paragraph (Link and anchor), and the second false indicates if linking af file in the filemanager should be imposible.


 


After you have saved the information to database and want to use the value in frontend, you can have Dynamicweb parse the link using Dynamicweb.Base.GetStrHref() - this method will find out if http is missing and so on.


 


You can also register the control found in Dynamicweb.Controls and use it inline in .aspx:


 
Reply
NP wrote:


Hi Regin




 




If you are using VB.net you can just do like this:




Dynamicweb.Gui.LinkManager("Default.aspx?ID=12", "NameOfField")




It will produce a normal linkmanager with the ability to link to files, internal pages or by typing an absolute URL.




 




Because the method i our class has some optional parameteres not supported by C# you have to specify a little extra parameters in C#:




Dynamicweb.Gui.LinkManager("Default.aspx?ID=12", "NameOfField", False, False)




 




The first false indicates if it should be impossible to link to a paragraph (Link and anchor), and the second false indicates if linking af file in the filemanager should be imposible.




 




After you have saved the information to database and want to use the value in frontend, you can have Dynamicweb parse the link using Dynamicweb.Base.GetStrHref() - this method will find out if http is missing and so on.




 




You can also register the control found in Dynamicweb.Controls and use it inline in .aspx:








Great, thanks,


 


And now the multibillion question...Default.aspx?ID=12...si that just a static page it must refer to, or should it refer back to the page it is called from..if yes how?

 
Nicolai Høeg Pedersen
Reply

Default.aspx?ID=12 was just an example.


 


When you have a linkmanager it is basically just an with some JS to fill in the value. After you have typed or selected a value, that value will probably be saved to a database. So when you reopen the item for editing you assign the value of linkmanager with the value from the database exactly as you would if it was a normal input field...

 
Reply
NP wrote:


Default.aspx?ID=12 was just an example.




 




When you have a linkmanager it is basically just an with some JS to fill in the value. After you have typed or selected a value, that value will probably be saved to a database. So when you reopen the item for editing you assign the value of linkmanager with the value from the database exactly as you would if it was a normal input field...





Ok, so the page field is actually just another field information?! However when trying to use LinkManager as stated I get the following error:


 


Compiler Error Message: CS1501: No overload for method 'LinkManager' takes '4' arguments



Source Error:










Line 39:
Line 40:
Line 41:
Line 42:
 

Line 38: 				
CSV File<%=Gui.LinkManager("thispage", "csvfile", false, false)%>







Source File: c:\DW\Application\CustomModules\servForm\servForm_edit.aspx    Line: 40

 
Reply

Found the solution by using extlinkmanager instead...Which actually was the one I was lloking for..


 


By the way, Isnt there an API documentation for the Dynamicweb classes?

 

You must be logged in to post in the forum