asp.netwebformsobjectdatasource

Can I use a defaultvalue for an ObjectDataSource Update-Parameter?


Can I use this ASPX-code in defining my ObjectDataSource control?

<UpdateParameters>
   <asp:Parameter Name="UID_KEY" Type="Int32"  DefaultValue="<%= hidUID_KEY.V"ALUE %>"/>

I am not fluent in the "ASP" special tags (<%= or <%...other tags, not sure if <%= is the correct syntax.) Further...must I convert the hidden-control-STRING to an Int32?
If so, please show me how to cast it within the above ASPX code. Thanks...John


Solution

  • Here is the example and the URL for more detail to use asp.net inline expression.

    https://learn.microsoft.com/en-us/troubleshoot/aspnet/inline-expressions

     <asp:Parameter Name="UID_KEY" Type="Int32"  DefaultValue="<%= Convert.ToInt32(hidUID_KEY.Value) %>"/>