Click here to Skip to main content
Click here to Skip to main content

Multiple form submittion with validator control in ASP.Net

By , 19 Jan 2007
Rate this:
Please Sign up or sign in to vote.
<!-- Article Starts - DO NOT ADD HTML/BODY START TAGS-->

Sample Image - Multiple_form_submittion.jpg

Introduction

In past I am not able to use two different section of form submit in ASP.Net 1.0 or 1.1using validation control. Now .Net Framework 2.0, it is possible to submit no of different section of form. On the other hand, in normal HTML we can place two or more form object for posting the data. Asp.Net can’t support the multiple form tag but there was different process to do same.

 
            <asp:Label  ID="lblUsername" 
                        AssociatedControlID="txtUsername" 
                        Text="User Name : "
                        Runat="server" />
            <asp:TextBox    id="txtUsername"
                            ValidationGroup="loginval"
                            runat="server"/> 
            <asp:RequiredFieldValidator 
                        ID="validator1" 
                        runat="server" 
                        Display="Dynamic"
                        ControlToValidate="txtUsername"
                        ValidationGroup="loginval"
                        Text="*(Required)" />


             <asp:Button id="btnSubmit"
                        ValidationGroup="loginval"
                        runat="server"
                        text="Login"
                        OnClick="onClick_btnSubmit" />    


Above code show you how you will perform the submit function each section respective validation control. For separating each section by “ValidationGroup” keyword, you can seen here I used “ValidationGroup” same for the textfield, validator control and button on which I will display the message. You can create multiple submittion for no of group submittion of data distinctly.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Nimit Patel
Web Developer
Canada Canada
I am always dream to good cricket player of indian team. I am cricket loving guy. I had passed my post graduation from IGNOU at vadodara, Gujarat,India. Presently working on asp.net, C#, sql server, php, mysql.

Comments and Discussions

 
GeneralIt's possible to have multiple webforms/page PinmemberJan Seda20-Jan-07 10:25 
Hello!
 
I know it's very unhappy that asp.net limits to only one webform. But we've implemented a component that overcomes it and you can have unlimited number of webforms par page.
 
We're using this on many projects like www.dotnetjob.com or other client's applications and this is obvious that client do required this functinality - fon instance to combine login (post webform), middle search (get form) and finally post webform etc.
 
So if anybody is going to be crazy by design of asp.net framework than contact me Wink | ;) We've already cured ourselfs Smile | :) )
 
Or there is a second option to use PHP and our Phalanger compiler to compile PHP into .NET. (see http://www.skilldrive.com/ProdPhalanger.aspx) Then there is no limit like in ASP.NET and you can use .NET and backend and PHP like legacy Active Server Pages there are much more simple to use and were the same popular as PHP is now Wink | ;)
 
Regards,
Jan Seda
www.skilldrive.com

GeneralRe: It's possible to have multiple webforms/page PinmemberSergey Rybalkin21-Jan-07 4:19 
GeneralRe: It's possible to have multiple webforms/page PinmemberJan Seda21-Jan-07 6:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 20 Jan 2007
Article Copyright 2007 by Nimit Patel
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid