Click here to Skip to main content
11,708,923 members (71,483 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi experts,

 I have a UserControl with two dropdowns. course and subcourse.
in my aspx page i am using usercontrol. when i save details and clear controls data
or reset that time i want to reset UserControl dropdowns selected item as default
e.g. --Select Course--
and --Select Sub-course--

please give me a solution for this.
thanx in advance.
Posted 1-Feb-13 23:08pm

1 solution

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

Solution 1

Create a reset function in user control

add this line to select whatever the value of item you have.

ddl.SelectedValue = "2";
  Permalink  
Comments
Wasim1989 at 2-Feb-13 5:50am
   
thanx for you solution but
i tried it doesnt work. function called properly and changed dropdowns value but in page usercontrols contains previously values
e.g. BE (course ddl)
and IT (sub-course ddl)
Irbaz Haider Hashmi at 2-Feb-13 6:21am
   
Can you send the code of it?

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 319
1 Maciej Los 235
2 Mika Wendelius 170
3 OriginalGriff 163
4 Peter Leow 139
0 OriginalGriff 9,253
1 Sergey Alexandrovich Kryukov 8,562
2 CPallini 5,189
3 Maciej Los 4,966
4 Mika Wendelius 3,856


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 2 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