locked
Pass a sqldatasource dataview and querystring parameter to Ajax Slideshow web function RRS feed

  • Question

  • User1909155429 posted
       <System.Web.Services.WebMethod()>
        <System.Web.Script.Services.ScriptMethod()>
        Public Shared Function RetrieveSlides() As AjaxControlToolkit.Slide()
    
            Dim dvProduct As DataView = CType(imagesSqlDataSource2.Select(DataSourceSelectArguments.Empty), DataView)
            Dim imageid As String = HttpContext.Current.Request.QueryString("ID")

    The Web Method does not accept server side code as normal.It first stated that it is not shared and when i instantiate as new class as mention it returned null values ?

    Wednesday, September 16, 2020 1:39 PM

Answers

  • User475983607 posted

    This is the expect VB.NET behavior.  Shared methods cannot access instance class members.  The data source is an instance member of the page class.   Use standard ADO.NET to do the select.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 16, 2020 3:55 PM

All replies

  • User475983607 posted

    This is the expect VB.NET behavior.  Shared methods cannot access instance class members.  The data source is an instance member of the page class.   Use standard ADO.NET to do the select.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 16, 2020 3:55 PM
  • User1909155429 posted

    Thanks, that answers my puzzle. The reason i wanted to pass a sqldatasource dataview object was because it filters the query on querystring parameter. i notice too that Ajax slides do not allow you to change the default shared property else it wont work.Although many examples show different??

    Friday, September 18, 2020 7:43 PM