Click here to Skip to main content
15,501,185 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Can shell32.dll be used in IIS environment? Pin
Richard Deeming20-Oct-21 23:17
mveRichard Deeming20-Oct-21 23:17 
GeneralRe: Can shell32.dll be used in IIS environment? Pin
Member 35932621-Oct-21 0:54
MemberMember 35932621-Oct-21 0:54 
GeneralRe: Can shell32.dll be used in IIS environment? Pin
Richard Deeming21-Oct-21 2:09
mveRichard Deeming21-Oct-21 2:09 
GeneralRe: Can shell32.dll be used in IIS environment? Pin
Member 35932621-Oct-21 23:46
MemberMember 35932621-Oct-21 23:46 
Questionweb config asp.net project of sql server Pin
Member 1101590512-Sep-21 20:20
MemberMember 1101590512-Sep-21 20:20 
AnswerRe: web config asp.net project of sql server Pin
Richard MacCutchan12-Sep-21 23:08
mveRichard MacCutchan12-Sep-21 23:08 
AnswerRe: web config asp.net project of sql server Pin
Dave Kreskowiak13-Sep-21 2:18
mveDave Kreskowiak13-Sep-21 2:18 
QuestionGet a Field value for recovery a password Pin
Luis M. Rojas3-Sep-21 6:17
MemberLuis M. Rojas3-Sep-21 6:17 
AnswerRe: Get a Field value for recovery a password Pin
Richard Deeming3-Sep-21 6:34
mveRichard Deeming3-Sep-21 6:34 
GeneralRe: Get a Field value for recovery a password Pin
Luis M. Rojas3-Sep-21 6:55
MemberLuis M. Rojas3-Sep-21 6:55 
GeneralRe: Get a Field value for recovery a password Pin
Richard Deeming3-Sep-21 7:10
mveRichard Deeming3-Sep-21 7:10 
QuestionWebService just will not work :-( Pin
Oliver Freeman1-Sep-21 6:48
MemberOliver Freeman1-Sep-21 6:48 
Hi all. I've tried for days now (quite literally) to get a simple web service to work, however it's like nothing in the $Ajax section is run at all. Can anyone help me with this, please?

There are two methods I've been trying, with an img with an OnClick or a button.

Both alerts work ("This button was clicked") but nothing else..

ASP.NET
<form id="form1" runat="server">
        
<p>Click on this paragraph.</p>
        <div>
            	     <img id="imgMediabtn" src="media/login.gif" onmouseover="this.style.cursor = 'pointer';" />
                   <asp:Button ID="Button4" runat="server" Text="Button" OnClientClick="BindTreeview()"/>    
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        </div>
    </form>


JavaScript
<script>
        $(document).ready(function () {
            $("p").click(function () {
                alert("The paragraph was clicked.");
            });

            $("#imgMediabtn").click(function () {
                alert("The image was clicked.");
                $.ajax({
                    type: "POST",
                    url: "MyWebService1.asmx/HelloWorld",
                    data: '{name: "' + $("#<%=TextBox1.ClientID%>")[0].value + '" }',
                     contentType: "application/json; charset=utf-8",
                      dataType: "json",
                    success:
                        function OnSuccess(response) {
                            alert("Hello");
                        },
                      failure: function (response) {
                          alert("Goodbye");
                    }
               
                  });
            });
        });

       
      
        function BindTreeview() {
            alert("The button was clicked.");
                   $.ajax({
                type: "POST",
                url: "TestWebService.aspx/GetCurrentTime",
                data: '{name: "' + $("#<%=TextBox1.ClientID%>")[0].value + '" }',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success:
                    function OnSuccess(response) {
                        alert(response.d);
                    },
                failure: function (response) {
                    alert(response.d);
                }
            })
        }

          

        }


ASP.NET
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class MyWebService1
    Inherits System.Web.Services.WebService

    <WebMethod()>
    Public Function HelloWorld(ByVal name As String) As String
        Return "Hello " & name & Environment.NewLine & "The Current Time is: " &
            DateTime.Now.ToString()
    End Function

End Class

AnswerRe: WebService just will not work :-( Pin
Richard Deeming1-Sep-21 22:59
mveRichard Deeming1-Sep-21 22:59 
GeneralRe: WebService just will not work :-( Pin
Oliver Freeman2-Sep-21 2:59
MemberOliver Freeman2-Sep-21 2:59 
GeneralRe: WebService just will not work :-( Pin
DerekT-P21-Oct-21 8:37
professionalDerekT-P21-Oct-21 8:37 
QuestionIs it possible to add fore ground and back ground to any app that is down? Pin
samflex31-Aug-21 19:39
Membersamflex31-Aug-21 19:39 
AnswerRe: Is it possible to add fore ground and back ground to any app that is down? Pin
Richard Deeming31-Aug-21 23:01
mveRichard Deeming31-Aug-21 23:01 
GeneralRe: Is it possible to add fore ground and back ground to any app that is down? Pin
samflex1-Sep-21 6:50
Membersamflex1-Sep-21 6:50 
GeneralRe: Is it possible to add fore ground and back ground to any app that is down? Pin
Richard Deeming1-Sep-21 22:47
mveRichard Deeming1-Sep-21 22:47 
GeneralRe: Is it possible to add fore ground and back ground to any app that is down? Pin
samflex2-Sep-21 4:02
Membersamflex2-Sep-21 4:02 
Questionproject code in .net for online banking transaction Pin
Jk 0724-Aug-21 6:12
MemberJk 0724-Aug-21 6:12 
AnswerRe: project code in .net for online banking transaction Pin
Richard MacCutchan24-Aug-21 6:40
mveRichard MacCutchan24-Aug-21 6:40 
GeneralRe: project code in .net for online banking transaction Pin
Member 1534301831-Aug-21 23:04
MemberMember 1534301831-Aug-21 23:04 
QuestionI am having problem creating a script to monitor Rest/API services. Pin
samflex23-Aug-21 9:11
Membersamflex23-Aug-21 9:11 
AnswerRe: I am having problem creating a script to monitor Rest/API services. Pin
Richard Deeming23-Aug-21 22:15
mveRichard Deeming23-Aug-21 22:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.