By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,563 Members | 1,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,563 IT Pros & Developers. It's quick & easy.

dropdown selected value

P: n/a
Hi..Me New to ASP.NET

I am trying to get the selected value from the dropdownlist but I m always
getting the first selected value ...I am giving the code down ...
<asp:dropdownlist id="ddlItems" runat="server" Width="130px">
Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ServerClick
(
Dim strItem As String
strItem = ddlItems.SelectedValue
)

cheers,
siaj
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
siaj:
Hey take a look at this FAQ entry:
http://www.openmymind.net/FAQ.aspx?documentId=2

you basically need to wrap your populating code in a !Page.IsPostback

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"siaj" <si**@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
Hi..Me New to ASP.NET

I am trying to get the selected value from the dropdownlist but I m always
getting the first selected value ...I am giving the code down ...
<asp:dropdownlist id="ddlItems" runat="server" Width="130px">
Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ServerClick
(
Dim strItem As String
strItem = ddlItems.SelectedValue
)

cheers,
siaj

Nov 19 '05 #2

P: n/a
Thanks Karl..
It helps..

Cheers,
siaj

"Karl Seguin" wrote:
siaj:
Hey take a look at this FAQ entry:
http://www.openmymind.net/FAQ.aspx?documentId=2

you basically need to wrap your populating code in a !Page.IsPostback

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"siaj" <si**@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
Hi..Me New to ASP.NET

I am trying to get the selected value from the dropdownlist but I m always
getting the first selected value ...I am giving the code down ...
<asp:dropdownlist id="ddlItems" runat="server" Width="130px">
Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ServerClick
(
Dim strItem As String
strItem = ddlItems.SelectedValue
)

cheers,
siaj


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.