Strange Problem with FormView Control

Discussion in 'ASP .Net Web Controls' started by Satamita, Jan 13, 2009.

  1. Satamita

    Satamita Guest

    We have a FormView control to show customer information with paging enabled
    in an .aspx page named Customer.aspx. We can navigate page by page to show
    customer information per page. FormView datasource has been a SqlDataSource
    control which is calling a stored Procedure. And FormView dataKey has been
    set to be customerID.

    Now in this page FormView nevigation is working well showing customer page
    by page order by their names.

    We have another page named Sales.aspx, from which we can get back to our
    previous page named Customer.aspx by clicking a button. At this time we are
    taking a particular customerID in Session and calculation the rowid/position
    of this customer [with an order by query which is the same with the stored
    procedure of FormView Datasource]. Now we are doing
    FormView1.PageIndex = CustomerPosition;

    So that we can directly go to the FormView page where this customer is and
    as FormView datakey is the customerID we can view this particular customer
    data in that FormView page.

    Instead of this we are having a wrong customer data in that page of
    FormView. What is more interesting here that not every time this is
    happening……sometimes it is working fine showing correct customer information
    in FormView pages and ‘Next’,’Previous’ working fine with correct results.
    Here by correct customer I mean that particular customer which belongs to
    that FormView page. We have checked our log file. There we have found out
    that after FormView pageindex has been changed, sometimes (randomly)
    FormView.selectedvalue is wrongly referring to a different CustomerID which
    was not the correct one.

    The whole behavior is completely random and does not have a recognizable
    pattern. Sometimes (randomly) FormView.selectedvalue is choosing a wrong
    value and it’s a read only field. While running it at our local boxes, the
    frequency of error is less whereas frequency of error is more when we are
    running it at our server. We are using windows server 2003, Sql server 2005
    and IIS6 and ASP.NET 3.0

    Any suggestions will be greatly appreciated. Thanks.
     
    Satamita, Jan 13, 2009
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.