question

alexsunny-9504 avatar image
0 Votes"
alexsunny-9504 asked alexsunny-9504 edited

Pass a sqldatasource dataview and querystring parameter to the Ajax Slideshow web function ?

Hello,

<System.Web.Services.WebMethod()>
<System.Web.Script.Services.ScriptMethod()>
Public Shared Function RetrieveSlides() As AjaxControlToolkit.Slide()
https://krogerfeedback.nl https://talktosonic.onl https://talktowendys.vip https://whataburgersurvey.onl
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 ?


thanks
alexsunny

sql-server-generaldotnet-aspnet-general
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Methinks you have the wrong tag for your question. Not that I know what the appropriate tag is, because being an SQL Server person, I don't understand much. But it does not seem to be an SQL Server question.

0 Votes 0 ·

Hi @alexsunny-9504,

Welcome to Microsoft Q&A!

It seems that your question is not related with SQL Server, suggest you add correct tags or repost your question with correct tags to get better help. You could find all products that supported on Microsoft Q&A forum from this link.

And I doing some research, found some links might help you as below:
Pass a sqldatasource dataview and querystring parameter to Ajax Slideshow web function
How to pass querystring to Ajax WebService


Best regards,
Carrin


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 Votes 0 ·

Hum, we need a bit more information.
It looks like you have a gridview here - you clicking on that gridview, and then wanting to use the ajax slide show. I would assume (think) the list of images (url's) to view is thus in the database.

Or maybe you have a datatable, and then filter on this that table into a dataview. So far so good.
But, since you already have a data view, then I don't see the need to hit sql server again then, ,right?

Now controls, and viewstate don't work in ajax calls, but session() most certainly does. So, I suggest you stuff your dataview into Session("MyView"). Now, in the ajax call, you can pull your dvProduct view back out of session and work from that - and do so without having to hit sql server again to load that table.

0 Votes 0 ·

1 Answer

YijingSun-MSFT avatar image
0 Votes"
YijingSun-MSFT answered

Hi @alexsunny-9504,

It first stated that it is not shared and when i instantiate as new class as mention it returned null values

You could put a break point (or use Watch) and check what is the count of Request.QueryString.
As far as I think,if you want to pass values in the querystring,you could use session which is far more secure than querystring.
About your problems,we need more details of your codes.
Best regards,
Yijing Sun

If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.