Microsoft KB Archive/232324

= PRB: Visual InterDev 6.0 Grid DTC User Interface Is Not Visible After a Roundtrip to the Server =

Article ID: 232324

Article Last Modified on 4/22/2001

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q232324



SYMPTOMS
In certain scenarios, you may find that your Grid Design-Time Control (DTC) user interface (UI) is not visually rendered when you click the Recordset Navigation button or the Page Navigation button. This happens most frequently when you call parameterized queries or stored procedures and use the Grid DTC to display the results. The Grid DTC user interface may not be displayed after a roundtrip to the server.



CAUSE
This behavior is due to a state preservation problem of the Grid DTC Script object. The _DG_Display function in the DataGrid.asp page from the _ScriptLibrary folder is used to display the user interface of the Grid DTC on the page. After the Active Server Pages (ASP) page makes a roundtrip to the server, the Recordset DTC, which the Grid DTC is bound to, may be lost. In these cases, the objRS._isEmpty function returns true when it is called by the _DG_Display function. As a result, the grid is not displayed on the page.



RESOLUTION
To work around this problem, add the following code to manually reopen the Recordset DTC in the Button1_onClick event handler: Sub Button1_onclick If Recordset1.isOpen then Recordset1.close end if Recordset1.setParameter 0,Textbox1.value Recordset1.open End Sub NOTE: If you are passing a value automatically to the Recordset DTC, for example when you specify Textbox1.value in the Value field of the Parameters tab of the Recordset DTC, you must remove that entry from the Value field. You do not want to use a DTC value as the default parameter in a Recordset DTC. When the next page arrow is clicked, the page is redrawn, and that value is temporarily lost. Therefore, an empty parameter is sent to the Recordset DTC.



Steps to Reproduce Behavior
Use the following steps to build a sample to call a parameterized query against the SQL Server "pubs" database and demonstrate how the Grid DTC can disappear unexpectedly.  Add a Data Connection to a project that connects to the SQL Server pubs database. Add a new ASP page to the project. Drag a Recordset DTC onto the page.  Use the following SQL statement for the Recordset DTC: SELECT * FROM authors WHERE State = ?  On the Parameters tab of the Recordset DTC, specify Textbox1.value in the Value field. Keep in mind that the parameter entry is case sensitive. On the Implementation tab of the Recordset DTC, clear the Automatically open the Recordset check box.</li> Drag a Textbox DTC, a Button DTC, and a Grid DTC onto the page below the Recordset DTC.</li> Bind the Grid DTC to Recordset1, and display the au_lname field.</li> On the Navigation tab, select the Enable paging check box, and then type 2 in the records/page text box.</li>  Add the following code to the Button1_OnClick event handler: Sub Button1_OnClick If Recordset1.isOpen Then Recordset1.close End If  Recordset1.open End Sub </li> In your browser, open the page. Type CA in the textbox, and click Button1. You should see that the Grid DTC is now populated with data.</li> Click one of the navigation buttons. The Grid DTC is no longer visible.</li></ol>

Additional query words: invisible navigate disappear blank navigation

Keywords: kbprb kbctrl KB232324

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.