Page 1 of 1
C# help
Posted: Thu Aug 11, 2016 11:22 pm
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
Re: C# help
Posted: Thu Aug 11, 2016 11:57 pm
by hallsofvallhalla
Are you using asp.net? Ajax?
Re: C# help
Posted: Fri Aug 12, 2016 12:12 am
by Avterra1d
No. Would I need to, to be able to do something like that?
Re: C# help
Posted: Fri Aug 12, 2016 12:24 am
by Avterra1d
I am using visual studio to make this and I am using the built in web page thing if that helps
Re: C# help
Posted: Fri Aug 12, 2016 1:03 am
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";
}
Re: C# help
Posted: Fri Aug 12, 2016 2:21 am
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
