We help IT Professionals succeed at work.

How to access querystring parameters from silverlight usercontrol?

jsmithr asked
Medium Priority
Last Modified: 2012-04-23
I have created a silverlight user control and embedded it in an aspx page. Both projects are in the same solution. I am trying to access a querystring parameter from the silverlight usercontrol. I found this solution online but am not able to comprehend how to impliment it.
Can someone assist?
Where do I put the code, in the silverlight user control or the aspx page?
I have tried a couple of different things, but I am still getting errors...


Public Partial Class Page1
	Inherits Page
	Public Shared InstancePage1 As Page1

	Public Sub New()
		InstancePage1 = Me
	End Sub

	' Executes when the user navigates to this page. 
	Protected Overrides Sub OnNavigatedTo(e As NavigationEventArgs)

	End Sub

End Class

Open in new window

Watch Question

Top Expert 2010
try this in your XAML codebehind

Imports System.Windows.Browser

string val = HtmlPage.QueryString("querystringkey").ToString()

Open in new window

hope this helps!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.