Click here to Skip to main content
11,565,672 members (46,044 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


Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | 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