Solved

Rebind Dataview...

Posted on 2006-11-13
2
275 Views
Last Modified: 2012-05-05
On my web page I have a DataView that is displaying results of a SQL table.  I've done some form validation to check if the user entered text into a textbox.  If the user forgets to enter text in the textbox and clicks the Submit Request button, a Label displays an alert telling them to enter text.  The problem is, is when the user clicks the Submit Request button, the page reloads and my DataView disappears, I would guess because there is no data for the DataView to display.

Is there a way for me to keep the values of the DataView when the Submit Request button is clicked and the page is refreshed?
0
Comment
Question by:convertix
2 Comments
 
LVL 12

Accepted Solution

by:
sandip132 earned 500 total points
ID: 17935452
Please refer this code: Check you are binding your DataView like this,

private void Page_Load(object sender, System.EventArgs e)
{
    if (!this.IsPostBack) {
          Inventory = new busInventory();
          // *** Get Item list into a table TItemList
          Inventory.GetItemList("sku,descript");
          // *** Do standard   for the list
          this.txtSearchSku.DataSource = Inventory.DataSet.Tables["TItemList"];
          this.txtSearchSku.DataBind();                                                                 //Bind your DataView in this loop
    }
}

0
 

Author Comment

by:convertix
ID: 17935487
Ah!  Makes sense.  I didn't have the Not IsPostBack.  Works great now.  Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

867 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

12 Experts available now in Live!

Get 1:1 Help Now