Click here to Skip to main content
13,559,022 members
Rate this:
Please Sign up or sign in to vote.
See more:
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
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";
Wasim1989 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02-2016 | 2.8.180515.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2018
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