how can I limit the # of characters to display for html.encode?
<%= Html.Encode(item.LastName.Substring(1,30))%>
error: Index and length must refer to a location within the string.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to check the strings length is greater than 30, otherwise you are specifying a length which will fall off the end of the string…(I’ve also changed your start index to 0 assuming you didn’t mean to leave out the first character)