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. General Programming
  3. C#
  4. how to submit a form based on a condition in C#

how to submit a form based on a condition in C#

Scheduled Pinned Locked Moved C#
csharpasp-netdatabasetutorialquestion
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.
  • S Offline
    S Offline
    Suman Singh
    wrote on last edited by
    #1

    Hi All, Wish all of you a very happy new year.....:) I want to submit a form based on a condition as I am doing with ASP. I have a user login form and i m checking the username and password with the database (SQLServer 2000). I want to do it in C# using ASP.net User will fill the form, username and password will be checked from the database. If no record found, form will be submitted on login.aspx, and if record found, it will be submitted on account.aspx. I m doing this by ASP code, but I want to use this in C# (Code behind) so that no body can see my code as it will be go will dll... I also don't want to use Response.Redirect()...

    function Validate() { document.login.submit(); } Validate(); Is there any way ???? Regards,:) Suman Singh:-O -- modified at 7:46 Thursday 5th January, 2006

    G 1 Reply Last reply
    0
    • S Suman Singh

      Hi All, Wish all of you a very happy new year.....:) I want to submit a form based on a condition as I am doing with ASP. I have a user login form and i m checking the username and password with the database (SQLServer 2000). I want to do it in C# using ASP.net User will fill the form, username and password will be checked from the database. If no record found, form will be submitted on login.aspx, and if record found, it will be submitted on account.aspx. I m doing this by ASP code, but I want to use this in C# (Code behind) so that no body can see my code as it will be go will dll... I also don't want to use Response.Redirect()...

      function Validate() { document.login.submit(); } Validate(); Is there any way ???? Regards,:) Suman Singh:-O -- modified at 7:46 Thursday 5th January, 2006

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Put runat="server" in the fields and use id to identify them: <input type="hidden" id="CustNum" runat="server"/> <input type=hidden id="mode" ruant="server"/> Now you can declare them in code-behind: protected HtmlInputHidden CustNum, mode; And set the values: CustNum.Value = "42"; mode.Value = "Paranoid"; --- b { font-weight: normal; } -- modified at 8:15 Thursday 5th January, 2006

      S 1 Reply Last reply
      0
      • G Guffa

        Put runat="server" in the fields and use id to identify them: <input type="hidden" id="CustNum" runat="server"/> <input type=hidden id="mode" ruant="server"/> Now you can declare them in code-behind: protected HtmlInputHidden CustNum, mode; And set the values: CustNum.Value = "42"; mode.Value = "Paranoid"; --- b { font-weight: normal; } -- modified at 8:15 Thursday 5th January, 2006

        S Offline
        S Offline
        Suman Singh
        wrote on last edited by
        #3

        and what will be the code to submit the form....

        G 1 Reply Last reply
        0
        • S Suman Singh

          and what will be the code to submit the form....

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          The same as you have now. --- b { font-weight: normal; }

          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