Skip to main content

Microsoft Silverlight

Answered Question get post dataRSS Feed

(0)

racsus
racsus

Member

Member

73 points

158 Posts

get post data

I have this address: http://localhost/hola_mundo.xaml?tipo=1

How can I get the data "tipo" in vb code?

Thanks, Oscar

rshelby
rshelby

Member

Member

277 points

66 Posts

Re: get post data

If you're on the client side it's:

Dim myQueryStringValue As String = System.Windows.Browser.HtmlPage.Document.QueryString("tipo")

On web service side it's:

Dim myQueryStringValue as String = HttpContext.Current.Request.QueryString("tipo")

 

Ryan Shelby

rshelby.com

rshelby
rshelby

Member

Member

277 points

66 Posts

Answered Question

Re: get post data

Sorry, I forgot to mention that if the querystring doesn't exist, it will throw an error using the above code.

To make sure the querystring value exists first use:

 

If System.Windows.Browser.HtmlPage.Document.QueryString.ContainsKey("tipo") Then

     Dim myValue As String = System.Windows.Browser.HtmlPage.Document.QueryString("tipo")

End If

Ryan Shelby

rshelby.com
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities