How to compile and run ashx file in visual studio?
I have
- ashx file,
- Visual Studio 10,
- Don't know at all about C # ASP.NET
What is the correct way to compile and run this?
Context
This ashx file can be found in this zip and is a demo application for the AI Tetris Competition . This is a very tempting idea, even if it depends a lot on luck, and I thought I could use this occasion to learn a new language.
source to share
An ASHX file is similar to an ASPX file, but it is a handler. This means that it does not respond to HTML by default and therefore may "process" otherwise unprocessed file types, but this is not necessarily related to this value. In this case, you will only present the answer
position=8°rees=180
... to the published board and chunk. Therefore you don't need HTML, therefore you want ASHX.
You can make .ashx files the start page in your project, just like .aspx pages. If I were writing the HelloUser.ashx page, I could set it as the start page, with some parameters passed as querystrings or whatever.
You will probably need some test wiring that will send the board / part to your service, and that could be any project. Command line program, website, test class run through NUnit, whatever. There is a lot of logic to keep track of the "player" logic.
If you need a more detailed answer, then SO might not be the place for this question. But I wish you all the best with that - it's an interesting problem.
source to share
You need to deploy it on an IIS server with the .NET framework installed and it should be.
If you are trying to get it working locally, create a website project in visual studio, go to "add existing items" in solution explorer and find your ashx. Then click the play button (or press F5) to compile and run it.
Good luck!
source to share
You are missing some form (maybe an ASPX file) that comes with this handler. It looks like this thing is probably handling some AJAX request from another page.
Also expected 2 pieces of data with the request:
string board = context.Request.Form["board"];
string piece = context.Request["piece"];
You can redesign the form as needed, but it will probably take a while to get the right pane.
source to share