Solved

Rebind Dataview...

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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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