Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Add record to a database without postback

Posted on 2009-06-27
5
600 Views
Last Modified: 2013-12-17
Hi,

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:

Header
-----------------------------------
M | Input1
E | Input2
N | Input3
U | Input4
-----------------------------------
Add

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?

Thanks,

Andre
0
Comment
Question by:andre72
5 Comments
 
LVL 15

Expert Comment

by:jinal
ID: 24727571
Hello ,

You can do that by using pure AJAX.

Try that.

0
 

Author Comment

by:andre72
ID: 24727720
Do you have a how to for me please?
0
 
LVL 18

Accepted Solution

by:
carlnorrbom earned 500 total points
ID: 24917067
Hi,

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">
        <ContentTemplate>
            Your input markup goes here.
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <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.

/Carl.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question