C# help

For discussions about game development that does not fit in any of the other topics.
Post Reply
Avterra1d
Posts: 3
Joined: Sun May 22, 2016 10:17 pm

C# help

Post by Avterra1d »

So I am trying to make a simple tool that will allow me to pull certain data from a web page and then send certain data back to the same web page but i am not sure how to pull the text from one of the text boxes into my program from the website. Any ideas? Not sure if I explained that correctly though
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: C# help

Post by hallsofvallhalla »

Are you using asp.net? Ajax?
Avterra1d
Posts: 3
Joined: Sun May 22, 2016 10:17 pm

Re: C# help

Post by Avterra1d »

No. Would I need to, to be able to do something like that?
Avterra1d
Posts: 3
Joined: Sun May 22, 2016 10:17 pm

Re: C# help

Post by Avterra1d »

I am using visual studio to make this and I am using the built in web page thing if that helps
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: C# help

Post by hallsofvallhalla »

Are you using c# on the back end? If so you can use HTML on the front and use ajax to pass the data.

For instance, on the HTML page you would put this in the javascript tags

Code: Select all

 function getRequests() {
        $.ajax({
            type: "POST",
            url: "ajaxscripts/GetStats.aspx/GetStats",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                Alert(msg.d);
            }
        });

    }
and this would be in C# on the backend

Code: Select all

 [WebMethod]
        public static string GetStats()
        {
            return "Works";
        }
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: C# help

Post by Jackolantern »

You could also use ASP.NET Web Forms. I don't typically recommend it for full-on applications since Web Forms can get difficult to maintain and don't follow modern web development patterns well, but it can be great for beginners to get their feet wet because you can create the pages with a drag'n'drop editor and the event-based model is extremely easy to understand :)
The indelible lord of tl;dr
Post Reply

Return to “General Development”