I have an ASCX that contains
<my:Foo ID="Bar" runat="server" Value='' />
I want to set Value
with textbox1.Text
, but Value
is an Int32. I am looking for something like this:
<my:Foo ID="Bar" runat="server" Value='<%= Int32.Parse(textbox1.Text) %>' />
But I get
Parser Error Message: Cannot create an object of type 'System.Int32' from its string representation '<%= Int32.Parse(textbox1.Text) %>' for the 'Value' property.
Is there a way to do this on the ASCX file? Do I have to implement a TypeConverter for this property?