Retrieving selected item text, value and index of an asp.net dropdownlist Part 21

preview_player
Показать описание
C#, SQL Server, WCF, MVC and ASP .NET video tutorials for beginners

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

To retrieve
Selected Item Text: DropDownList1.SelectedItem.Text
Selected Item Value: DropDownList1.SelectedItem.Value
OR
Selected Item Value: DropDownList1.SelectedValue
Selected Item Index: DropDownList1.SelectedIndex

The SelectedIndex and SelectedValue properties of the DropDownList can also be used to have a list item selected in the DropDownList.
Рекомендации по теме
Комментарии
Автор

Selected Text, Value, and Index functionality explained well with an example. 
I recommend this video to others to watch.
Thanks a lot

krismaly
Автор

Minute 11 regarding the post back just fixed my entire issue and now I can continue with my project. Much love <3

TheSlippyDips
Автор

Dear Sir, again an excellent tutorial, thank you. Wow, this is the first time you mentioned, that something caused trouble to you. It is good to know, and good to learn from you how to avoid these problems.
People, please turn off AD-blockers and watch all advertisements to say a big thank you to Mr Venkat :-)))

Trzbne
Автор

my Gosh you have saved my life! was searching for this for bout 2 hours now, and finally u brought me the answers, thank you so much! great vid btw :D thank u so much

CarlosAppleduardo
Автор

Page_Prerender event, fires just before the page is rendered to the client. This is your last chance to inspect or change any of the HTML that is generated by the server. There are several scenarios where this event could be useful. I will make a video on these scenarios as soon as I can.

Csharp-video-tutorialsBlogspot
Автор

thank u Sir Kudvenkat there are so many usefull video :)

sevdacimen
Автор

postback also troubles me... but now it works.. thanks for the video sir...

FunnyKidzzzZone
Автор

Very use full training videos, Thanks sir.

murugapandian
Автор

Dear Sir, very nice tutorial . I love you <3 . Kiss kiss in the mix

sergiuk
Автор

i'm from Egypt and my home language is Arabic but your videos is very easy to learn and
comprehensive useful thanx so much
one question? i want to learn data structures and algorithm in c# if you don't mind i need good material to study it

programmerrafik
Автор

Sir your videos are very helpful. You are doing a great job... Thanks ..
Looking for your videos on some UI technologies like JS and jQuery.

ankitank
Автор

I really like your videos, any idea how to get the "Select All" Values from the drop down list into a Grid view? I've being looking around and cannot find

yuririvera
Автор

Hi Sir,

Your videos are very good, they helped me .

Can you explain about page_prerender event

thanks.


winK
Автор

Thanks for uploading Asp.net vedio it's very helpful, sir I want to know how to retrieve data from databases and reflect it in radio button and check box when we are using text changes event

rashmihassan
Автор

Hi! If I have a table whith columns Id, Country, City, Zip. And in dropdownlist Text="City" and Value="Id". When I click on button, could I take other properties of SelectedItem(Country and Zip)?

danyocean
Автор

Hi sir, Thank you so much for the videos.
 Could you please help me in 
    displaying the corresponding data in textbox retrieved from the database on the dropdown selected item without using gridview...I tried a lot...please help

pinky
Автор

better to give control to the button ..then we will not face such problem ..#page_Load..(!IsPostBack)


protected void Button1_Click(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "-1")
{
Response.Write("please enter continent Value");
}
else
{
+ "<br/>");
+ "<br/>");
+ "<br/>");
}

swapnilsonsurkar