How to use reset button in content template (without <form> </form>)
-
Requirment is to use "reset" functionality without postback. 1. We can use standard reset button. It will be part of a form. It will clear the form elements just clicking it. No separate code required to clear the elements. Moreover, post back will not take place. 2. If we donot use standard "reset" button, but use HTML button for reset, then we will have to write our own code to reset. Moreover page post back will also take place. It can be done without writing code also if we user server.transfer("same page"). My requirement gets fulfilled with option 1. But issue is that I am using master(content) template in all web forms. Because of this <form> </form> is not part of aspx file. In this case, when i try to use standard reset button, its functionality does not work because this button is not under <form> </form>. So how to use reset functionality withot writing code and without post back in my requirement.
-
Requirment is to use "reset" functionality without postback. 1. We can use standard reset button. It will be part of a form. It will clear the form elements just clicking it. No separate code required to clear the elements. Moreover, post back will not take place. 2. If we donot use standard "reset" button, but use HTML button for reset, then we will have to write our own code to reset. Moreover page post back will also take place. It can be done without writing code also if we user server.transfer("same page"). My requirement gets fulfilled with option 1. But issue is that I am using master(content) template in all web forms. Because of this <form> </form> is not part of aspx file. In this case, when i try to use standard reset button, its functionality does not work because this button is not under <form> </form>. So how to use reset functionality withot writing code and without post back in my requirement.
-
HI, Issue is that we are inheriting a template in each webform. That's why <form></form>section does not appear. Without <form></form>, reset functionaly does not work. So looking for solution where we can use the reset functionalit in a particular template.
-
HI, Issue is that we are inheriting a template in each webform. That's why <form></form>section does not appear. Without <form></form>, reset functionaly does not work. So looking for solution where we can use the reset functionalit in a particular template.
I have no problem creating a masterpage that has the form tags and then inside the .aspx having a standard reset button that resets the form fields without a post back. You are going to need to better define what you are looking for because I must not be understanding what you are looking for, and from the lack of responses I must not be alone in my confusion.
<%@ Page Title="" Language="VB" MasterPageFile="~/masterpage.master"
AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Default" %><asp:Content ID="Content1" ContentPlaceHolderID="body" runat="Server">
<asp:TextBox runat="server" ID="tb" />
<input type="reset" value="Reset" title="reset" />
</asp:Content>