This project is read-only.

How to pass variable to xmldataprovider...?

Feb 27, 2009 at 4:45 PM
Hello all,
I have the following Slide.Show 2 control in a page called profile_post.aspx:


object type="application/x-silverlight-2" data="data:application/x-silverlight-2," width="232" height="232" >
param name="background" value="#ffffff" />
param name="source" value="Vertigo.SlideShow.xap" />
param name="initParams" value="ConfigurationProvider=XmlConfigurationProvider;Path=xml_Configuration_SlideShow_Profile_Post_Small.xml,DataProvider=XmlDataProvider;Path=xml_GetSlideShowData.aspx"/>

The page xml_GetSlideShowData.aspx that is referenced as the path for the XmlDataProvider calls a database and then dynamically generates xml content for the slideshow.  I have verified that this works properly and the Slide.Show 2 control fires up and starts displaying images.  However, I want to be able to pass a variable to the xml_GetSlideShowData.aspx page so that the database called in that page can have different select parameters based on that variable.  The variable that I want to pass happens to be in the URL of the profile_post.aspx page (i.e., profile_post.aspx?PostID=<<guid>> ).

So my question is how can I get that PostID variable in the profile_post.aspx page's URL added into the "Path=xml_GetSlideShowData.aspx" portion of my initParams for the Slide.Show 2 object markup show above so that this variable is in turn passed in the URL that opens the xml_GetSlideShowData.aspx page in the background wherein the xml content is dynamically generated?

Many thanks in advance for any help that anybody can provide...MDCragg

Feb 27, 2009 at 6:16 PM

I figured out another way to do this...I declared a session variable in the profile_post page that is referenced by the xml_GetSlideShowData when it queries data then builds the xml content.  I ran into a caching problem in the xml_GetSlideShowData page however so I had to add the following lines to the page load event:


Response.CacheControl =

Response.AddHeader("Pragma", "no-cache")
Response.Expires = 0



Once I did this it started working properly.