I am Using a Textbox in my Web application in asp. I want to enter the quantity of the product to appear as 
my aspx code is
<asp:TextBox ID="TextBox4" Width="55px" Height="39px" TextMode="Number" runat="server" min="1" max='<%# Eval("Quantity") %>' step="1"></asp:TextBox>
and cs page code is
int quantity = Convert.ToInt16(TextBox4.Text);
where is wish to access the selected quantity of my TextBox4. But is shows the error that The input string is not in the correct format
Am i not using the correct input format?
Set the initial text like this
<asp:TextBox id="textbox4" Width="55px" Height="39px" TextMode="Number" runat="server" min="1" max='<%# Eval("Quantity") %>' step="1" Text="0"></asp:TextBox>
this will solve ur problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With