Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to use reset button in content template (without <form> </form>)

How to use reset button in content template (without <form> </form>)

Scheduled Pinned Locked Moved ASP.NET
htmlasp-netsysadminhelptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amittinku
    wrote on last edited by
    #1

    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.

    D 1 Reply Last reply
    0
    • A amittinku

      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.

      D Offline
      D Offline
      droth17
      wrote on last edited by
      #2

      javascript

      A 1 Reply Last reply
      0
      • D droth17

        javascript

        A Offline
        A Offline
        amittinku
        wrote on last edited by
        #3

        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.

        D 1 Reply Last reply
        0
        • A amittinku

          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.

          D Offline
          D Offline
          droth17
          wrote on last edited by
          #4

          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>

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups