Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
i want when i click on particular item of dropdownlist(ddlprdct of my form)i want its product cost should come in a given textbox .i am not able to achieve through ddlprd_selectedindexchange but same i can achieve on clicking button...y so ...how can i achieve through ddlprd_selectedindexchange ?
pls tell
regards
Posted
Comments
Avik Ghosh22 7-Feb-13 8:13am    
use autopostback and ispostback properly..
vinodkumarnie 1-Apr-13 7:20am    
You got solution for your question..? If no share your code that you have tried..

The details you have given are not enough. This is my understanding - you are filling up the TextBox on the server side. You are not able to do it on selected index change change event of the DropDownList. But the same is working when you click a button and post back the form.

I guess you are missing setting the AutoPostBack property of the DropDownList. Set it to true and it should work fine. So your drop down should like something like this:
XML
<asp:DropDownList ID="ddlprd" runat="server" AutoPostBack="True" onselectedindexchanged="ddlprd_SelectedIndexChanged">
</asp:DropDownList>
 
Share this answer
 
v2
<asp:dropdownlist id="ddlprdct" runat="server" xmlns:asp="#unknown">
onselectedindexchanged="itemSelected">



protected void itemSelected(object sender, EventArgs e)
{
//Write logic to get Selected Item price.

obj.product= txtProductPrice.text;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900