PRB: No Data Is Returned from Server When You Use PageObject DTC with Page Running on Windows 2000 (261249)



The information in this article applies to:

  • Microsoft Visual InterDev 6.0, when used with:
    • Microsoft Internet Information Server 5.0

This article was previously published under Q261249

SYMPTOMS

When you use the Visual Interdev PageObject Design-Time Control (DTC) on a page that is hosted on Microsoft Windows 2000, you may find that no data is returned from the server-side remote script page. In addition, you may not receive any errors in the browser.

This problem only occurs if the client-side event code that calls the server-side function is located on a separate page from the server-side function. If they are both located on the same page, you may encounter other problems. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

275447 PRB: ASP 0234 Error "Server side include directives may not be present in script blocks" with PageObject DTC

CAUSE

In Visual InterDev 6.0 Service Pack 2 (SP2) and earlier, the following code to include the remote scripting page (Rs.asp) was added to the page within the server-side JavaScript block when an Execute method was specified in the Methods tab of the PageObject properties:
<!--#INCLUDE FILE="_ScriptLibrary/rs.asp"-->
				
In Internet Information Server (IIS) 4.0, you can include files within server-side script blocks. In IIS 5.0, server-side include directives cannot be placed within a script block. Because the error occurs on the ASP page that is called by remote scripting and not by the page that is displayed in the browser, no error message is returned to the client; the return value of the function is not returned, and an empty message box appears.

RESOLUTION

Microsoft Visual Studio 6.0 SP3 or later adds this line of code outside of the server-side JavaScript script block. To resolve this problem, upgrade to Visual Studio 6.0 SP3 or later on your development computer. You can download the latest version of Visual Studio from the following Microsoft Web site: For existing applications, you must delete the existing PageObject DTC and add a new one to update the code.

MORE INFORMATION

Steps to Reproduce Behavior

NOTE: Make sure that the Active Server Pages (ASP) page is created on a development computer with Visual InterDev 6.0 SP2 or earlier and is run on a Windows 2000-based Web server.
  1. Add an ASP page named Server.asp to your Visual InterDev project.
  2. Add the following server-side script block to Server.asp:
    <SCRIPT LANGUAGE=vbscript RUNAT=Server>
    function testVal()
    testVal = "From the server"
    end function
    </SCRIPT>
    					
  3. Add a PageObject DTC to Server.asp.
  4. Right-click PageObject, and then click Properties. On the Methods tab, in the Execute Methods drop-down list, click testVal.
  5. Add an HTML page named Client.htm to your Visual InterDev project.
  6. Add a PageObject DTC to Client.htm.
  7. Right-click PageObject, and then click Properties. On the References tab, specify Server.asp as an existing object reference.
  8. Add an HTML button named button1 to Client.htm, and then paste the following code to the button1 onclick event:
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
    <!--
    function button1_onclick() {
    var strVal = Server.execute.testVal().return_value;
    alert(strVal);
    }
    //-->
    </SCRIPT>
    					
  9. Save the page, and then view it in your browser. Click the button, and an empty message box should appear.

REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

275447 PRB: ASP 0234 Error "Server side include directives may not be present in script blocks" with PageObject DTC


Modification Type:MinorLast Reviewed:12/12/2005
Keywords:kbCtrl kbprb KB261249