Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6964033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:52:21+00:00 2026-05-27T15:52:21+00:00

I’m working with a VB.Net page which calls a web method from JavaScript, this

  • 0

I’m working with a VB.Net page which calls a web method from JavaScript, this was working upto a week ago and now for some reason is not working. I was wondering if anyone could give me any idea where to look as I am completely lost right now.

Firstly my page generates a list of items that can be clicked, The line that does this is:

 TicketHTML = TicketHTML + "<td><img src='../images/delete.png' Class='imgTicketClose'  alt='Delete Task' onclick='DeleteTicket(" + row("id").ToString() + ")' /></td></tr>"

I know this is working as when the item is clicked I get a javascript popup so I would assume the problem is not here.

Now my Javascript:

    function DeleteTicket(ticketID) 
     {
        var answer = confirm("Do you really want to delete this task?")
        if (answer) 
        {
           PageMethods.DeleteTask(ticketID);
           window.location.reload()
        }
     }

I assume the problem is here as the web method never seems to call and the page doesnt seem to reload either, but I dont understand why this would be failing if the javascript displays the confirm dialog.

In the interest of completeness here is my web method though I know this is not being called as I have profiled the database.

 <System.Web.Services.WebMethod()>
   Public Shared Sub DeleteTask(ticketID As Integer)
  Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("Blueprint").ToString())

  Dim cmd As New SqlCommand
  cmd.CommandType = CommandType.StoredProcedure
  cmd.CommandText = "spDeleteNonTicketItem"
  cmd.Parameters.AddWithValue("@ItemID", ticketID)

  cmd.Connection = conn

  conn.Open()

  cmd.ExecuteNonQuery()

  conn.Close()

   End Sub

So where could I look? Any advice would be greatly appreciated. Thanks

EDIT: Could anything in the web.config file be preventing page methods from executing?
I have just noticed this happening with a completely seperate web method and have checked the integers being passed into the javascript with an alert() and they are all valid

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:52:22+00:00Added an answer on May 27, 2026 at 3:52 pm

    EDIT – I can see you have added the WebMethod attribute.

    One thing you can do is add an error handler to your page methods call. You can usually supply method handlers for onsuccess and onError.

    For example, you can add the following javascript method:

    function OnFailed(error) {
       // Alert user to the error.
       alert(error.get_message());
    }
    

    And then, in your PageMethods call:

        function DeleteTicket(ticketID)    
        {      
            var answer = confirm("Do you really want to delete this task?");      
            if (answer)       
            {         
                PageMethods.DeleteTask(ticketID, null, OnFailed);         
                window.location.reload();      
            }   
        } 
    

    Just found a StackOverflow question with an example of this. Note also the effects of CustomError in web.config.

    Further Edit.

    Have you done a release recently?

    You need to make sure that:

    1) On the ScriptManager of your page, EnablePageMethods=”true” is set

    2) Web.config should have the following lines in the relevant sections:

    <system.web>
    <httpHandlers>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" 
    type="Microsoft.Web.Script.Services.ScriptHandlerFactory" 
    validate="false"/>
    </httpHandlers>
    <httpModules>
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
    </system.web> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.