Learning Silverlight 2 Series (13): The WebRequest of data and communication

Source: Internet
Author: User
Tags silverlight

This article will briefly describe how to use WebRequest for data submission and acquisition in Silverlight 2.

Simple example

In this article, we still use the example of the Silverlight 2 series (12) in step by step: The WebClient used in data and communication, except to make minor changes, submit book Number data using WebRequest, and return price information based on the book number. The results of the final run are shown below:

To write an interface layout, the XAML is as follows:

<grid background= "#46461F" >
<Grid.RowDefinitions>
<rowdefinition height= "></RowDefinition>"
<rowdefinition height= "*" ></RowDefinition>
<rowdefinition height= "></RowDefinition>"
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<border grid.row= "0" grid.column= "0" cornerradius= "15"
Width= "height=" "36"
margin= "0 0 0" horizontalalignment= "left" >
<textblock text= "book list" foreground= "white"
Horizontalalignment= "left" verticalalignment= "Center"
margin= "0 0 0" ></TextBlock>
</Border>
<listbox x:name= "Books" grid.row= "1" margin= "40 10 10 10"
selectionchanged= "Books_selectionchanged" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<textblock text= "{Binding Name}" height= "></TextBlock>"
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<border grid.row= "2" grid.column= "0" cornerradius= "15"
Width= "height=" background= "Orange"
margin= "0 0 0" horizontalalignment= "left" >
<textblock x:name= "Lblprice" text= "Price:" foreground= "white"
Horizontalalignment= "left" verticalalignment= "Center"
margin= "0 0 0" ></TextBlock>
</Border>
</Grid>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.