I have a bunch of textboxes that the user is suppose to enter integer values into them. How can I set the default to zero (0)?
Reason being, I am getting the following error if the user does not enter anything in that box:
Input string was not in a correct format.
Stack Trace
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat)
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value)
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value)
[InvalidCastException: Cast from string "" to type 'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value)
ASP.Metrics_aspx.ImageButton_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\ System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
[/red]
Reason being, I am getting the following error if the user does not enter anything in that box:
Input string was not in a correct format.
Stack Trace
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat)
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value)
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value)
[InvalidCastException: Cast from string "" to type 'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value)
ASP.Metrics_aspx.ImageButton_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\ System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
[/red]