.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Reset button to change the value of dropdown lists

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :ASP.Net


I have 4 dropdown lists adjacent to eachother that are only visible depending on the value of the preceeding dropdown. The dropdowns contain information relating to injuries and the plan is to make the users choose items from the dropdown list to define their injuries.

 - The first dropdown defines what kind of injury (laceration, bruise, break etc...)

 - The second defines where (arm, head, neck, finger)

 - The third defines further detail (left, right, N/A)

 - The last defines further detail again (upper, lower, N/A etc...)

I basically want a reset button that when clicked, resets the value's of these dropdowns to their initalvalue; '{Select}' (as i have a required field validator preventing '{Select'} from being the given value)

can someone please assist. I'd quite like the button to postback so that the change happens and the page refreshes and i need the validations to refresh also.

Alternatively is someone has a better approach feel free to let me know your thoughts. I don't have an current code as I haven't even been able to ge this working yet!

View Complete Post

More Related Resource Links

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Change Button Text in Multi Language Website


Hi i developing multi language website

using Master pages

everything fine

Page_Load i set the Text property of Button Control from Resource file

like this

Button1.Text = GetLocalResourceObject("Button1")

then in the button click event i cnage the text of the Button control

Button1.Text = GetLocalResourceObject("Button1_new")

but the text doesn't change and no error messgae

what is the problem how to solve this


change image button image


i am making a web form with a VB code behind.  on the form I have a down arrow imageButton that when pressed hides certain data.  what i want to do is change the button to an up arrow and vice versa whenever pressed.  i have both images loaded onto my project already.  any suggestions.

thank you

How do I change the default HTML code for a collection of lists and views


I have modified the html display code of some lists and content query web parts in SharePoint designer.  This works well when modifying a few lists, but I have many lists and different views with these many lists.

Is there a way to modify the template code for a site so that all my lists, views and CQWPs display identically with my modified code?  Managing these individually is not practical.

Button to copy selected item in dropdown to textbox

Hi, I found this bit of code which I tried and it isn't working. I just want to place a button next to a dropdown, and when clicked, the selected item in the dropdown will put into another textbox. <head><title>Untitled</title></head><body><script type="text/javascript">function copy() {var sel = document.getElementById("names");var text = sel.options.value;var out = document.getElementById("output");out.value += text+"\n";}</script> <select id="names"><option>Product One</option><option>Product Two</option><option>Product Three</option><option>Product Four</option></select><input type="button" onclick="copy()" value="Copy"><textarea id="output"></textarea> </body></html>   I saved this as a file and opened it in IE to test and nothing went into the textarea. Also i tried it in Firefox and the textarea said undefined each time I click the button. Can someone help to get this working?

Change "View Report" button style

Hi,    How can i change the style of button "View Report" ? I want to change the image.     Tks!    

change tab index by pressing enter button widthout postback

hi .  i have 3 textbox :<asp:textbox id="textbox1" runat="server" text="01" ></asp:textbox><asp:textbox id="textbox2" runat="server" text="02" ></asp:textbox><asp:textbox id="textbox3" runat="server" text="03" ></asp:textbox>  how i can focus on textbox2 from textbox1 by pressing enter button (widthout postback)?

Change image button image on hover

Hoep this si simple I would like to change the image in an image button when the user hovers over it ..can anyone helpThanks  

what should i add, or change to maintain the addition on the page at button click, yes i know why, b

 - select day using the drop down list  - select the start date using calender (causes an event), a table is made having the dates of the day selected from the start date and shown to the user.  - the table also contains checkbox for each row in a cell  - the user selects the check boxes he wants  - and clicks the button  - the button calls the method in the .cs file which SHOULD TRAVERSE THE TABLE ROWS TO FIND THE ticked checked boxes and the rest is self explanatory the problem ----------- on calender selection change event nothing is lost, but on button click event all things in table created by code is lost. (as the debugger shows that the row count is zero). i understand that in the page cycle the rows etc added the form by the date change event of the calender are not preserved. fine. but whats the solution. please help i have been searching for a solution desperately. the source --------      <asp:Calendar ID="Calendar1" runat="server"          >         <SelectedDayStyle BorderStyle="Dotted" BorderWidth="4px" />         <TodayDayStyle BorderStyle="Solid" BorderWidth="4px" HorizontalAlign="Center"              

Gridview Editing with dropdown lists inside

  Hi, Any good  Example for Editable Grid with dropdownlist inside ? Getting some problem in updating the data   Thanks 

How can I change XSL in WSS 3.0 for Search Layout - I need to add a button\link "Edit Item"?

Hi, WSS 3.0 on SQL Server 2008 for Workgroups Does anyone know where the xsl file is to change the Search Layout (NOT MOSS) and/or do you know of any links that are useful? Thanks. John.

asp.net and dropdown lists

I have an assignment that is way overdue and need some help in setting it up.  It says to have two additional dropdowns that allow selection of a telephone handset and a service plan adn this info comes from an access database.  Three check boxes should allow independent selection of the 3 additional options (which are voicemail, unlimited data, unlimited text) available.  I already tried doing this using but found that I would need to update all the fields in the database after the entries have been made.  Can someone please help me in setting this up?  I don't expect anyone to do it for me, just need some help with how to set it up.  This is from a class last spring and my memory is somewhat boggled.   Frantically frustrated :-(  

DropDown button with tree and multiple choices?

Hi!I am searching for a combobox like control but where a tree will be shown in the dropdown(instead of a list) and multiple choices have to be possible.I have thought of implementing this http://code.google.com/p/dynatree/ in combination with a jquery dropdown button but it will be alot of work to get there.Do you ave any solution for this?BestRegardsSnowJim

What i have to write on on click reset button?


 i make a little form to submit company information into database, tell me that What i have to write on on click reset button to clear all fields?

How to change from button post back to autopostback

Can anyone help me with how to change from an update button to an autopostback, so that every time the info is changed it will be updated.

<%@ Page language="c#" Inherits="GreetingCardMaker.GreetingCardMaker" CodeFile="NewGreetingCardMaker.aspx.cs" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml">
		<title>Greeting Card Maker</title>
		<form runat="server">
			<div style="BORDER-RIGHT: thin ridge; PADDING-RIGHT: 20px; BORDER-TOP: thin ridge; PADDING-LEFT: 20px; FONT-SIZE: x-small; PADDING-BOTTOM: 20px; BORDER-LEFT: thin ridge; WIDTH: 293px; PADDING-TOP: 20px; BORDER-BOTTOM: thin ridge; FONT-FAMILY: Verdana; HEIGHT: 486px; BACKGROUND-COLOR: lightyellow">Choose 
				a background color:<br />
				<asp:DropDownList id="lstBackColor" Height="22px" Width="194px" runat="server">

change index of dropdown in gridview


 i have got grid view with 4 coloums which contains 2 dropdown list. n i have 2 drop down list out side the gridview .

i want to change the index of the 1st coloum  dropdown list inside the gridview when changing the drop down list  index outside using javascript

similarly the when the 2nd dropdown list(out side ) index change the 2nd coloumn dropdown list in gridview should change..

 In short the outside placed dropdown list should act as master dropdown list.

Central Administration not Available, STSADM password reset errors "job-admin-apppool-change" alread


Hi Everyone,

I think I've shot myself in the foot by not properly following set up instructions.

I have a two-fold problem.  Firstly, my Sharepoint Central Administration V4 site is showing Service Not Available.  This seems to be related to the credentials the Central Administration V4 Application Pool - hitting Test Settings within IIS Manager for the site shows an Authentication and Authorization error for the credentials due to a bad password.

My reading indicates that I should run something to the effect of:

%STSADM -o updatefarmcredentials -userlogin DOMAIN\username -password <new password as set via AD>

This runs into the following Error message

Error deploying administration application pool credentials. Another deployment may be active. An object of the type Microsoft.SharePoint.Administration.SPAdminAppPoolCredentialDeploymentJobDefinition named "job-admin-apppool-change" already exists under the parent Microsoft.SharePoint.Administration.SPTimerService named "SPTimerV4".  Rename your object or delete the existing object.


I've tr

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend