Click here to Skip to main content
15,921,959 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi,
Please guide writing the C# code for reset,save button in ASP.NET.

Regards
Posted
Comments
Prerak Patel 8-Sep-11 0:46am    
Not clear. Did you try anything?
sandeepatil 8-Sep-11 0:54am    
hi,
I am new to ASP.NET. I have a screen which has buttons and dropdownlists.Whenever the parameter is selected in the dropdownlist and save button is pressed the current settings(selected values) should be saved in the data base.So i need the syntax to write code for save and reset in C#.

1 solution

hi sandeep,

for reset button
you have to generate onclick event of your button. and in code behind you have to clear all your controls.

protected void Button_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
DropdownList1.SelectedIndex=0;


}

and on savebutton depending on your functionallity you have to do it.if you want to save the values in db depending upon what db you are using you have to open connection to that then write a query to save it. and then close the connection.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900