A non-integer value is entered as student id
/grades.aspx?stu dentid=1283128s df
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.FormatEx ception: Input string was not in a correct
format.
In aspx file
<asp:ObjectData Source ID="object1" runat="server"
SelectMethod="G etScores" TypeName="Grade Book">
<SelectParamete rs><asp:QuerySt ringParameter Name="studentId "
Type="Int32" QueryStringFiel d="studentid" DefaultValue="0 "
/></SelectParameter s>
</asp:ObjectDataS ource>
The problem is I can't use try catch in the .aspx file. How can I solve this
problem
/grades.aspx?stu dentid=1283128s df
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.FormatEx ception: Input string was not in a correct
format.
In aspx file
<asp:ObjectData Source ID="object1" runat="server"
SelectMethod="G etScores" TypeName="Grade Book">
<SelectParamete rs><asp:QuerySt ringParameter Name="studentId "
Type="Int32" QueryStringFiel d="studentid" DefaultValue="0 "
/></SelectParameter s>
</asp:ObjectDataS ource>
The problem is I can't use try catch in the .aspx file. How can I solve this
problem
Comment