Overview
When developing Silverlight applications, we often encounter situations in which the Silverlight application's UserControl to get the asp.net page parameter, this parameter does not necessarily come from the host page of the current Silverlight application, but may come from other asp.net pages.
Demand
As in the following project structure, we will need to pass two values to the Silverlighttestpage.aspx page in the Default.aspx page, And it needs to be captured and displayed in the Silverlight application hosted by the Silverlighttestpage.aspx page:
The Default.aspx page appears as shown in the following illustration:
When you click the Submit button, you move to the Silverlighttestpage.aspx page and pass two parameters, as shown in the following code:
protected void btnSubmit_Click(object sender, EventArgs e)
{
Response.Redirect(String.Format("SilverlightTestPage.aspx?username={0}&email={1}",
this.txtUserName.Text,
this.txtEmail.Text));
}