Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Dynamic contentlink web part

  Asked By: David    Date: Mar 16    Category: Sharepoint    Views: 728

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 ******

Share: 

 

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.




Tagged: