?
Solved

ASP.Net  Vb Public Shared Function Variable

Posted on 2010-09-04
3
Medium Priority
?
1,016 Views
Last Modified: 2012-05-10
Hi

I'm trying to add a variable to the below code, but every time I do I get an error:

Microsoft JScript runtime error: Sys.Net.WebServiceFailedException: The server method 'GetSlides' failed with the following error: System.InvalidOperationException-- Invalid web service call, missing value for parameter: 'Nodeinfo'.

My code is below can any one help?  (and befor any one asks txtnode.Text does exist)

Thanks

Brasso


<System.Web.Services.WebMethod(), System.Web.Script.Services.ScriptMethod()> _
    Public Shared Function GetSlides(ByVal Nodeinfo As String) As AjaxControlToolkit.Slide()


        Dim imgSlide(3) As AjaxControlToolkit.Slide
       
        imgSlide(0) = New AjaxControlToolkit.Slide("images/Chrysanthemum.jpg", "Autumn", "Autumn Leaves")
        imgSlide(1) = New AjaxControlToolkit.Slide("images/Desert.jpg", "Creek", "Creek")
        imgSlide(2) = New AjaxControlToolkit.Slide("images/Hydrangeas.jpg", "Landscape", "Landscape")
        imgSlide(3) = New AjaxControlToolkit.Slide("images/Jellyfish.jpg", "Dock", "Dock")

        Return (imgSlide)
    End Function

'Call Function

 GetSlides(txtnode.Text)

Open in new window

0
Comment
Question by:brasso_42
3 Comments
 
LVL 3

Expert Comment

by:aledev
ID: 33605973
Hi
what browser did you use for try this code? and are you running this from IIS?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 33608769
This appears to be a web method, and it shouldn't be static (Shared)...
0
 
LVL 1

Accepted Solution

by:
brasso_42 earned 0 total points
ID: 33609522
Hiu

The answer is you cant directly.  You have to use Contextkey of you slideshowextender.

e.g.

    <System.Web.Services.WebMethod()> _
      <System.Web.Script.Services.ScriptMethod()> _
    Public Shared Function GetSlides(ByVal contextKey As String) As AjaxControlToolkit.Slide()
then

  SlideShowExtender1.ContextKey = txtnode.Text

to call the function / chage slides

thanks any way

brasso


0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question