Solved

Using the ajax tab feature

Posted on 2008-06-10
1
234 Views
Last Modified: 2013-11-26
I am developing a form using the ajax tabs and update panels to prevent postbacks. My main problem is this: When a user enters his or her last name into the text box and clicks the submit button all is well until I go to another tab where there is a dropdown box containing the last names is displayed, but because I am avoiding the postback, the dropdown box does not contain the newly entered last names. I have a Sub routine that loads the last names on page load, but if I add it to the button click event, the data is loaded again; therefore, displaying it twice. How do I get the data to only refresh the new last name without adding duplicates to the dropdown box? I am pretty sure that I should use an if statement, but I am not sure where to put it or how to construct.

Thanks
0
Comment
Question by:cyberSteveG
1 Comment
 
LVL 5

Accepted Solution

by:
cwickens earned 200 total points
Comment Utility
Without a postback to the server, the newly entered names dont get retrieved from the DB, you could add a DataBind() to your submit button that would DataBind the the names list (gridview, detailsview or whatever is holding the list).  If you put all of it inside an updatepanel, you would not have a full page refresh either...

hope this helps,
c
 Protected Sub btn_submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_submit.Click

        'Dim your list of names container

        Dim myGridview as GridView = Me.GridView1

       

        'Do your submit code

        myGridview.DataBind()
 

    End Sub

Open in new window

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

743 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now