Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NETC#4.0.NET4
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 7-Feb-13 2:09am
Comments
Avik Ghosh22 at 7-Feb-13 8:13am
   
use autopostback and ispostback properly..
vinodkumarnie at 1-Apr-13 7:20am
   
You got solution for your question..? If no share your code that you have tried..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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:
<asp:DropDownList ID="ddlprd" runat="server" AutoPostBack="True" onselectedindexchanged="ddlprd_SelectedIndexChanged">
</asp:DropDownList>
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<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;
}
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 840
1 OriginalGriff 437
2 Abhinav S 303
3 thatraja 215
4 Emre Ataseven 200
0 Sergey Alexandrovich Kryukov 8,122
1 OriginalGriff 4,520
2 Peter Leow 3,744
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid