Common_CustomJavaScript_CSharp\AddArgumentsToWebRequest.aspx.cs
// Copyright 2010 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // You may freely redistribute and use this sample code, with or // without modification, provided you include the original copyright // notice and use restrictions. // // See the use restrictions. // public partial class AddArgumentsToWebRequest : System.Web.UI.Page { protected void Page_Load(object sender, System.EventArgs eventArgs) { // Register the Postback button with the ScriptManager control so it issues // postbacks asynchronously when clicked. Note that controls registered in // this way must implement either INamingContainer, IPostBackDataHandler, or // IPostBackEventHandler. ScriptManager1.RegisterAsyncPostBackControl(Button2); } protected void Button2_Click(object sender, System.EventArgs eventArgs) { // Get the page request parameters System.Collections.Specialized.NameValueCollection requestParameters = Page.Request.Params; // Update label text with the custom request parameters. // pageInputTag is from a hidden input element that is explicitly defined in page markup. // dynamicInputTag is from a hidden input element that is dynamically added via JavaScript. // inlineArgument is dynamically added to the page request via JavaScript before the request // is sent to the server. Label1.Text = requestParameters["pageInputTag"]; Label2.Text = requestParameters["dynamicInputTag"]; Label3.Text = requestParameters["inlineArgument"]; } }