We help IT Professionals succeed at work.

How to access querystring parameters from silverlight usercontrol?

jsmithr
jsmithr asked
on
Medium Priority
870 Views
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...

http://forums.silverlight.net/p/204007/477356.aspx

Public Partial Class Page1
	Inherits Page
	Public Shared InstancePage1 As Page1

	Public Sub New()
		InitializeComponent()
		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

Comment
Watch Question

Top Expert 2010
Commented:
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.