?
Solved

ASP.Net  Vb Public Shared Function Variable

Posted on 2010-09-04
3
Medium Priority
?
1,004 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 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