Click here to Skip to main content
12,243,038 members (38,118 online)
Rate this:
 
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 2-Feb-13 0:08am

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 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 | Mobile
Web02 | 2.8.160426.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2016
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