473,563 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET Reset Controls to default values question

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_S electedIndexCha nged(object
sender, System.EventArg s e)
{
// need to reset all page controls to original setting
if (ddlStartMonth. SelectedItem.Va lue == "2")
{
ddlStartDay.Ite ms.RemoveAt(33) ;
ddlStartDay.Ite ms.RemoveAt(32) ;
ddlStartDay.Ite ms.RemoveAt(31) ;
}
else if (ddlStartMonth. SelectedItem.Va lue == "4")
{
ddlStartDay.Ite ms.RemoveAt(33) ;
}
else if (ddlStartMonth. SelectedItem.Va lue == "6")
{
ddlStartDay.Ite ms.RemoveAt(33) ;
}
else if (ddlStartMonth. SelectedItem.Va lue == "9")
{
ddlStartDay.Ite ms.RemoveAt(33) ;
}
else if (ddlStartMonth. SelectedItem.Va lue == "11")
{
ddlStartDay.Ite ms.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
Nov 17 '05 #1
0 1977

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
10978
by: Chris Lane | last post by:
Hi, I have an HTML RESET button and Web Control Button that posts back to the server. Problem is the reset button doesn't work after the postback occurs. Any ideas or suggestions as to why this happens or how I can work around this? Thanks
1
14309
by: NancyASAP | last post by:
Thought I'd share this since it took me a long time to get it working. Thanks to a bunch of contributers in Google Groups who shared javascript, etc. The question was: How can I put a reset button on my ASP.NET web page, and have an HTML reset button click clear 1) all validator text display and 2) validation summary display. Problem was...
2
4831
by: Lance | last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property. But, for complex property types (e.g., instance types) this does not work because System.ComponentModel.DefaultValue requires a constant value In...
0
2391
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event, which I am). I now want to read the text/values of those controls. I have found out that I can read the values if I wait until Page_Load, but then I...
11
7399
by: newbie | last post by:
i have a form in which a hidden field (initial value as '0', and my javascript set it to '1' when an event is trigged). In the same form, i have a reset field. But I realized that the hidden field is not reset to '0' when i push the reset button. If I simply change the node from "<input type="hidden" id='IsChanged' value='0'>" to "<input...
3
4049
by: Dave Hughes | last post by:
Hi, I've run across a problem styling form controls (quel surprise), or rather in this case, "unstyling" them. I'm trying to put together a theme for a web application which has a fairly primitive theme engine. Specifically, I can define *additional* CSS rules using the theme engine, but I can't remove the pre-existing ones that come with...
16
2074
by: Giovanni D'Ascola | last post by:
Hi. I noticed that <input type="reset"actually don't enable checkbutton which are checked by default after they have been disabled by javascript. It's a bug?
1
1222
by: artev | last post by:
if in a page I have a search form, where want use metho reset() for reset default value I notice that after a research, for the method, the default values isn't more the initially load form but that of the research; notice the form is inner the same result's page ; so I think reset() see how default values only the last form and not those...
3
1705
by: artev | last post by:
if in a page I have a search form and I want use the method reset() for reinsert the default values, I notice that after a research, for the method reset(), the default values aren't more that first time loaded in the form but that of the form set for the search (I think so); see that the form is inner the same result's page, pheraphs the...
0
7659
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7882
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.