Add record to a database without postback


I need a good idea how to do something like this:
I've to add new entries to a database using a web interface.
The "Add" button is outside the input fields in a footer of the page so I can't do anything in one updatepanel (customer like to have so).
So it would look like this:

M | Input1
E | Input2
N | Input3
U | Input4

I like to only let the main part of the side refresh after a "Add" and start again with empt fields.
My only idea how to do is to parse the input fields with javascript, submit the data and send a refresh to a updatepanel container of the input fields.

Is there any easier way how to do?


Who is Participating?
carlnorrbomConnect With a Mentor Commented:

If you need to keep the add button outside the update panel you can add it as async postback trigger such as:

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            Your input markup goes here.
            <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />
    <asp:Button ID="btnAdd" runat="server" Text="Add" />

This way the update panel will refresh even though the add button is placed outside the update panel.

Hello ,

You can do that by using pure AJAX.

Try that.

andre72Author Commented:
Do you have a how to for me please?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.