Solved

Rebind Dataview...

Posted on 2006-11-13
2
281 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
[X]
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
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 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