Solved

Rebind Dataview...

Posted on 2006-11-13
2
267 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
Comment Utility
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
Comment Utility
Ah!  Makes sense.  I didn't have the Not IsPostBack.  Works great now.  Thank you!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

11 Experts available now in Live!

Get 1:1 Help Now