views:

1491

answers:

3

I have an ASP.NET page. What I want to do is pass in an ID field that is in the querystring.

So if my page is

http://www.mysite.com/default.aspx?id=35

I want a silverlight control that is on this page to have access to the id field. My silverlight control is going to get data for a grid and it needs to use the id.

+5  A: 

You can use the HTML DOM Bridge to do that:

using System.Windows.Browser;

string queryString = HtmlPage.Document.DocumentUri.Query;
Michael S. Scherotter
Keep in mind that the page can prevent you from usign the HTML DOM Bridge if enableHtmlAccess is set to false.
Maurice
+5  A: 

While this covers the concept in startup parameters (which is possibly what you are doing) here's a walk-through about it. http://silverlight.net/learn/learnvideo.aspx?video=72312

Tim Heuer
Tim - that is EXACTLY what I was looking for. You also show 2 other ways, which I didn't know about. Thanks a million!
Scott
A: 

okey but http://www.site.com/videoplayer.aspx?id=2 how can ı take id?

watch timheuer's videos. it's all in there
Scott