Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Dynamic contentlink web part

  Asked By: David L.         Date: Mar 16, 2010      Category: Sharepoint      Views: 185
 

Does anyone know how to dynamically set the xml contentlink for a
web part via vbscript?
I've tried using the following code... but, it basically redirects
the entire page to the dynamically generated page I want.
I would prefer that the content be generated in the web part.

***** start code *****

Function getContent(xmlndPart)
Dim sContent
Dim strUsername, adsUser, group
strUsername=Replace(ucase(Factory.Variables.Item
("LOGON_USER")) , "\", "/")
sContent = "<DIV class=""UserGeneric""><script
language=""VBScript"">" & vbCRLF & " window.Location.HRef
=""http://sdntp01/inout/"
set adsUser = getObject("WinNT://" & strUsername)
for each group in adsUser.groups
if instr(1,lcase(trim(group.name)),"home server") then
sContent = sContent & trim(right(trim
(group.description),7)) & ".aspx"" " & vbCRLF & "</script>"
exit for
end if
next
sContent = sContent & "</DIV>"
getContent = sContent
End Function

****** end code ******


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:        

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Dynamic contentlink web part Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].