1
You have not mentioned that what you are using... asp.net web forms or MVC...
in both case these solution will help you...
Asp.net webforms:
https://www.aspsnippets.com/Articles/Populate-one-DropDownList-based-on-another-DropDownList-selected-value-in-ASPNet.aspx
MVC:
http://stackoverflow.com/questions/27901175/how-to-get-dropdownlist-selectedvalue-in-controller-in-mvc
1
Hi,
The question is not clear buddy. What I understand you need to dispaly all or particular user information on page load.
Example 1 :
- protected void DropDownList1_DataBound(object sender, EventArgs e)
- {
- DropDownList1.SelectedValue
- }
Reference :
http://stackoverflow.com/questions/5961488/how-can-i-get-the-selected-item-of-a-dropdownlist-the-first-time-my-page-loads
https://www.aspsnippets.com/Articles/DataBinding-DropDownList-Label-and-Textbox-Controls-in-ASP.Net.aspx
0
hi umair,
if you wanted to select gender coming from database as Male, female, these are your items in your dropdown then you can bind as follows
ddlgender.SelectedItem=gendercomingfromdbr;
if gender coming from database are in your dropdown values then
ddlgender.SelectedValue=gendercomingfromdbr;
0
my question is so precise and clear if for example on user login gender is male then on profile page ddl gender should be male value selected and in the case of female ,ddl gender should be female selected
0
hey there !
The question is not clear here, you have to a littlebit more precise what you are asking for ? May be you are asking for cascading dropdownlist - here is the source you can check that :
http://www.c-sharpcorner.com/UploadFile/009464/cascading-one-dropdownlist-with-other-dropdownlist-in-asp-ne/
Hope that helps!