Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
c_Service2.ID = Convert.ToInt16(hfId_Check_Box1_Checked.Value);

why not work?
Posted
Comments
CPallini 1-Oct-14 9:46am    
What is the error message?
ghanem90 1-Oct-14 9:50am    
the message: Input string was not in a correct format.
Richard Deeming 1-Oct-14 9:46am    
Because the value in the hidden field isn't an integer? (Since you haven't told us what the value is, we can only guess.)
ghanem90 1-Oct-14 9:51am    
the value integer
Richard Deeming 1-Oct-14 9:52am    
Well it's clearly not an integer, is it? Otherwise, you wouldn't be getting a FormatException.

1 solution

As others have said, the only reason it won't work is because the Value of the hidden field is not an Int16.

This is very easy for you to debug and figure out why.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900