Solved

Rebind Dataview...

Posted on 2006-11-13
2
283 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 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