Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using jquery tab control in my web application, I am displaying aspx pages inside tabs, I have a single button to save values which are entered in these asp pages controls.
This is my tab control with save button

ASP.NET
<div id="tabs">
        <ul>
            <li><a href="Test1.aspx"><span>Test</span></a></li>
            <li><a href="Test2.aspx">Second</a></li>
            <li><a href="#tabs-3">Third</a></li>
        </ul>
    </div>
    <div>
        <asp:Button ID="btntest" runat="server" OnClick="btntest_Click" Text="Submit" />
    </div>


and this is my Test1.aspx
ASP.NET
<form id="form1" runat="server">
        <table>
            <tr>
                <td>Firstname:</td>
                <td>
                    <asp:TextBox ID="txtname" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>Lastname:</td>
                <td>
                    <asp:TextBox ID="txtlname" runat="server"></asp:TextBox></td>
            </tr>
        </table>
    </form>


Test2.aspx
ASP.NET
<form id="form1" runat="server">
       <table>
           <tr>
               <td>Age:</td>
               <td>
                   <asp:TextBox ID="txtage" runat="server"></asp:TextBox></td>
           </tr>
           <tr>
               <td>Occupation:</td>
               <td>
                   <asp:TextBox ID="txtoccup" runat="server"></asp:TextBox></td>
           </tr>
       </table>
   </form>


Now I want to save the values which are entered in Firstname, lastname, age and occupation fields. How can I access these controls in btntest_Click?
I want functionality that if on any tab,user click save button,it will save the respected form data.
Or is there any other solution/control for this?

What I have tried:

I have tried using jquery tab control, Also I have tried asp.net multi-view but in multi-view I cant display web pages in side View.
Posted
Comments
Sinisa Hajnal 19-Apr-16 3:02am    
Send form data as ajax request to web method / controller that saves it into the database.
F-ES Sitecore 19-Apr-16 4:39am    
It depends how the pages are shown inside the tabs, but regardless I doubt you'll be able to do this as you can only access controls that are on the same page, and I don't mean visually there in the browser using tricks like ajax\iframes etc.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900