Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET Reset Controls to default values question

Reply
Thread Tools

ASP.NET Reset Controls to default values question

 
 
psinyc
Guest
Posts: n/a
 
      08-06-2003
this may be a simple thing ... I am trying to reset all
the page controls to their original setting, in the first
line of this method call (event). I want to dynamically
change the days of month in a dropdownlist list depending
on the users selected month in the month's
dropdownlist ... i am using AutoPostBack on the
dropdownlists ... can anyone offer suggestions? Thanks ..
here's the method ..

private void ddlStartMonth_SelectedIndexChanged(object
sender, System.EventArgs e)
{
// need to reset all page controls to original setting
if (ddlStartMonth.SelectedItem.Value == "2")
{
ddlStartDay.Items.RemoveAt(33);
ddlStartDay.Items.RemoveAt(32);
ddlStartDay.Items.RemoveAt(31);
}
else if (ddlStartMonth.SelectedItem.Value == "4")
{
ddlStartDay.Items.RemoveAt(33);
}
else if (ddlStartMonth.SelectedItem.Value == "6")
{
ddlStartDay.Items.RemoveAt(33);
}
else if (ddlStartMonth.SelectedItem.Value == "9")
{
ddlStartDay.Items.RemoveAt(33);
}
else if (ddlStartMonth.SelectedItem.Value == "11")
{
ddlStartDay.Items.RemoveAt(33);
}
}

what happens is the first month selected works, but now
the items have been removed from the dropdownlist, so the
second time the method is called, it's not working with
the full, default 31 day dropdownlist.

Sorry for the lengthy post, thanks ..
psinyc
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
You will not be able to reset the access - can't reset. jc MCAD 0 12-09-2007 08:58 PM
CISCO 7XX / 761 password reset or reset to factory defaults Philipp Flesch Cisco 3 06-18-2006 07:47 PM
How to reset the colors of a Label to Default Peter Kellner ASP .Net 0 04-19-2006 09:17 PM
Specifying dynamic default values for properties in custom controls: Praveen Ramesh ASP .Net Building Controls 0 09-02-2004 06:41 PM
IDS 4215 reset to factory default Marshall Stacks Cisco 1 12-18-2003 03:55 AM



Advertisments