2

my dropdownlist HTML5

<select runat="server" id="ddlStateLegalRes" name="ddlStateLegalRes"></select>

On my page load I am binding my dropdownlist to a list collection with a list of states

Original question was answered created a new question as it is a different erorr

1 Answer 1

1

If I understand the question correctly you need to do this:

ddlStateLegalRes.Items.FindByValue(sdr["STATEOFLEGALRESIDENCE"].ToString()).Selected = true;
Sign up to request clarification or add additional context in comments.

7 Comments

hutchonoid thanks for your response can you please see my updated question and let me know if you could help?
I would move this List<StateList> states = ops.getStates(); to outside of the is not post back. I suspect that on post back u are not populating again.
The original question was answered, you should leave it as accepted. Create a new question & send me it pls.
Sorry hutchonoid last time I did that I got yelled at for not unaccepting the answer and editing the question that is the only reason I did that. But I will do it again and hope not to get yelled at again so many rules here hard to keep up :)
Also i thought the same thing and tried that but it still results in the same error
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.