473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

I couldn't obtain value when the selected index position is changed in dropdownlist?

hai,

this is an example code to dispaly the data, if the index position is changed in dropdownlist....
private void ddlcountryid_SelectedIndexChanged(object sender, System.EventArgs e)
{
string temp=ddlcountryid.SelectedItem.ToString();
txtcountryid.Text =temp;
}

but if i execute this,
the value is not displaying when i change the index position, but if i click any button on that page, then the value is shown in the txtcountryid textbox... i don't know y????????

help me....
Mar 22 '07 #1
1 1002
channaJ
67
hai,

this is an example code to dispaly the data, if the index position is changed in dropdownlist....
private void ddlcountryid_SelectedIndexChanged(object sender, System.EventArgs e)
{
string temp=ddlcountryid.SelectedItem.ToString();
txtcountryid.Text =temp;
}

but if i execute this,
the value is not displaying when i change the index position, but if i click any button on that page, then the value is shown in the txtcountryid textbox... i don't know y????????

help me....
You can do this by setting the AutoPostBack property of the ddl to true.
Mar 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Earl Teigrob | last post by:
I want to write a function where I pass in a reference to a dropdownlist and a "match value" and have it returns the index of the dropdownlist item that matchs (or -1 if there is no match) ...
1
by: jm | last post by:
I know how to set the ddl.selectedindex = x. That is not the problem. I have a dynamically populated DropDownList populated from a database. I use the onitemdatabound to populate the list when...
5
by: DC Gringo | last post by:
I have a dropdownlist that, upon form submission, I'd like to maintain the selected value when I get my result...how do I do that? <asp:dropdownlist Font-Size="8" id="ddlCommunities"...
6
by: Nathan Sokalski | last post by:
I am writing a User Control that uses 3 DropDownLists. When I attempt to access the SelectedIndex property it incorrectly reports the value selected by the user. Why is this? Here is my code,...
1
by: Atreju | last post by:
Ok I got form within a c sharp page. Situation: On the form I have a drop downliwst and a textbox, the dropdownlist is populated with products and the textbox has a default vale of the product...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
3
by: Jeff | last post by:
Hey ASP.NET 2.0 When the selection in a DropDownList is changed, an SelectIndexChanged(object sender, EventArgs e) is triggered. I'm wondering if it is possible to get the new selected...
0
by: Moneypenny | last post by:
Hi there, I have a Gridview control which has a dropdownlist in every row. The dropdowns are populated dynamically from a database (so the content is different in each row. There is also a select...
6
Frinavale
by: Frinavale | last post by:
I have a control that is supposed to allow the user to either allow or cancel what they were doing. When I apply this to a <select> element (or DropDownList), I cannot save the original value to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.