title: Change the property "DefaultValue" of the asp.net "ControlParameter" control with javascript
body: <p>I already have an idea on how to do this, but I realized that the control "ControlParameter" did not have an "Id" property (which is needed for the JS). Is there a different way to use JavaScript to change the "DefaultValue" property without the need of using the "Id" property? </p>
  
  <p>Here is the JavaScript and asp.net code that I have been working with:</p>
  
  <p>JavaScript:</p>
  
  <pre><code>        function ChangePropertyValue(propertyName, newpropertyValue) {
          var ControlParameter = document.getElementById(propertyName)
          ControlParameter.DefaultValue = newpropertyValue
      }
  </code></pre>
  
  <p>asp.net:</p>
  
  <pre><code>        &lt;asp:Button ID="btntest" runat="server" Text="try" OnClick="ChangePropertyValue(??, 17)"/&gt;
  
          &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
          ConnectionString="&lt;%$ ConnectionStrings:DatabaseConnectionString1 %&gt;" 
          SelectCommand="SELECT [Id], [ContentTitle], [Content] FROM [Table1] WHERE ([Id] = @Id)"&gt;
          &lt;SelectParameters&gt;
              &lt;asp:ControlParameter ControlID="ListView1" DefaultValue="16" Name="Id" 
                  PropertyName="SelectedValue" Type="Int32"/&gt;
          &lt;/SelectParameters&gt;
      &lt;/asp:SqlDataSource&gt;
  </code></pre>