Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: .NET3.5 ASP.NET C#4.0
I have one form containing dropdownlist with 4 values in it fetching from database and have one button.
now on page load i have written coding for fetching data in dropdownlist and i am getting that and i select one value from it but when i click on button for "additional functionality" on it then dropdownlist also get refreshed(the value i selected is replaced by first value in dropdownlist...i tried of autopostback on button and too on dropdownlist but had no affect
.how can i stop this
pls tell
Posted 7-Feb-13 1:29am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


I guess you are loading your dropdown in all the pageloads, irrespective of whether its a post back or not.
You can load your dropdown only if its a initial page load and not a post back.
//then your code here
Hope this helps.
shivani 2013 at 7-Feb-13 7:42am
thanks.i have one more issue that i want when i click on particular item of 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 can i achieve through ddlprd_selectedindexchange ?
pls tell
manognya kota at 7-Feb-13 9:12am
Once you fix this problem, you should be able to get the selected item in your index change.Can you post your code for the button click and the selected index change?

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,580
1 OriginalGriff 8,370
2 Peter Leow 4,859
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,301

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100