SharePoint - Dynamically Setting a property on a webpart. Possible with inline C# code block ? or Javascript?
I want to dynamically set the FilterValue1 property of a Content by Query to the querystring IDs value.
I tried to do it with an inline embed FilterValue1="<%= Reponse.Write .. but no luck
Without having to code my own webpart, any way to change the property value with a small C开发者_如何学Go# code block on the aspx page?
How about with javascript?
Thank you!
You need some code, but it is very simple and fast.
Please, take a look at great post from well-known SharePoint expert Andrew Connel:
http://www.andrewconnell.com/blog/archive/2008/02/18/Subclassing-the-Content-Query-Web-Part-Adding-Dynamic-Filtering.aspx
As you see on last Andrew's screenshot, it is exactly what you need:
精彩评论