C# help
C# help
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
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: C# help
Are you using asp.net? Ajax?
Re: C# help
No. Would I need to, to be able to do something like that?
Re: C# help
I am using visual studio to make this and I am using the built in web page thing if that helps
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: C# help
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
and this would be in C# on the backend
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);
}
});
}
Code: Select all
[WebMethod]
public static string GetStats()
{
return "Works";
}
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: C# help
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