Click here to Skip to main content
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)



Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid