[Mono-bugs] [Bug 398318] New: Assigning value to sqlDataSource. ConnectionString causes FormView values to be reloaded

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jun 7 18:46:16 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=398318


           Summary: Assigning value to sqlDataSource.ConnectionString causes
                    FormView values to be reloaded
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: x86-64
        OS/Version: openSUSE 10.3
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: psoldack at wp.pl
         QAContact: mono-bugs at lists.ximian.com
          Found By: DeveloperNet


Created an attachment (id=220885)
 --> (https://bugzilla.novell.com/attachment.cgi?id=220885)
FormViewCrash.zip - test application

Description of Problem:
The scenario is that there are many database servers to be used and proper one
is selected during run time. So ConnectionString value of sqlDataSource is
calculated and assigned at run time.
In MS.NET it can be simply done in PageLoad function. It has to be assigned in
every PageLoad call (even though it get the same value every time) as it is not
remembered by sqlDataSource. In MS.NET it works fine. But in Mono there is one
problem. If during postback sqlDataSource.ConnectionString is assigned a value
(in PageLoad) then FormView reloads all controls with values from
sqlDataSource, so all data entered by user are lost.
Solution would be not to assign ConnectionString's value when IsPostBack==true,
but it will work only in Mono, not in MS.NET, because MS.NET sqlDataSource
doest remember connection string :(

To be able to have same code running in Mono and MS.NET this problem has to be
solved.


Steps to reproduce the problem:
1. Download and unzip attached FormViewCrash.zip to selected folder
2. Go to that folder and change ConnectionString value in Default.aspx and
Default.aspx.cs to any valid MySQL database (needed to start data provider).
3. Run xsp2
4. Open browser and browse to Default.aspx
5. Select any record. Type in some text in textbox.
6. Click "Do postback"
7. Notice that textbox was reloaded and your text was lost (only in Mono, in
MS.NET textbox doesn't reload)
8. Unckeck "Reset ConnectionString"
9. Repeat steps 5 and 6. Notice that value was not reloaded.

Small explanation: In attached file there is ConnectionString hardcoded in
Default.aspx not to let application crash under MS.NET.

How often does this happen? 
Always


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list