Form Processing Question

Last post 03-07-2009 4:18 PM by aburningflame. 2 replies.

Sort Posts:

  • Form Processing Question

    03-07-2009, 1:41 PM
    • Member
      1 point Member
    • aburningflame
    • Member since 02-15-2009, 6:26 PM
    • Posts 7

    I know i can set a form action to "" and have it be processed by the page its on.
    However, This isnt good practice especially for large applications

     In JSP you have a form, it gets submitted to a servlet, that servlet processes it, then sends an appropriate redirect

    Ex: form action="loginHandler.jsp">>>loginHandler.jsp(process & send redirect)>>failedLogin.jsp or home.jsp;

    Is there an equivalent to this in ASP.net? Heres what Im trying to do

     <form id="loginForm" method="post" action="formProcessors/loginHandler.aspx">
                <fieldset>
                <span class="label">Username:</span>
                <input class="text" type="text" name="username"/>
                </fieldset>
                
                <fieldset>
                <span class="label">Password:</span>
                <input class="text" type="password" name="password"/>
                </fieldset>
                
                <fieldset>
                <input type="submit" class="center" value="Log in"/>
                </fieldset>
      </form>

    In my loginHandler.aspx on page load, I do:
    If(isPostBack){//process}

     When I click the login button on my form..nothing happens

    Filed under:
  • Re: Form Processing Question

    03-07-2009, 1:50 PM
    Answer
    • Star
      9,042 point Star
    • HosamKamel
    • Member since 01-19-2006, 6:49 PM
    • Egypt
    • Posts 1,308
    You can use cross page PostBack Cross-Page Posting in ASP.NET Web Pages http://msdn.microsoft.com/en-us/library/ms178139.aspx http://www.aspdotnetfaq.com/Faq/How-to-make-Cross-Page-Postback-in-ASP-Net.aspx Also you can try the new ASP.NEt framework ASP.NET MVC http://www.asp.net/learn/mvc-videos/ where you can us normal forms post approach to post to a controller class.
    Hosam Kamel

    Remember to click on Mark as answer on the post that helped you
  • Re: Form Processing Question

    03-07-2009, 4:18 PM
    • Member
      1 point Member
    • aburningflame
    • Member since 02-15-2009, 6:26 PM
    • Posts 7

     Thanks a lot man. Exactly what i was looking for.

     Quite a bit of work to implement :(, but i got it working.
    I went the x-page post back method, dont wanna learn a new framework as of yet :p

     Thanks for your help.

    Appreciate it :)

Page 1 of 1 (3 items)