Click here to Skip to main content
11,484,640 members (60,479 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET PHP White
Hi everyone.
i got some real AWESOME code from this website regarding white board
(here it is ...http://www.codeproject.com/Articles/167763/Fun-with-HTML5-Canvas-WebSocket-JQuery-and-ASP-NET )

I loved this project so much so that i picked it for my final year bachelor project.
Since i am learning php of my own i want to know how can i run this project in php...i don't want to run it in asp.net....

The author shows us how to run it in asp.net :Running the white board Application
Follow these steps to run the white board application:
Download the whiteBoard.zip (Download link at the top of this article) and extract it......and so on.

I know this post is too long to read...

************All i want to know is how can i run this project in php, whatever the way it is please suggest me***************

Thanks in advance.
Posted 28-Mar-12 23:46pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You have to rewrite the .Net code into php, which will be a lot of work (if even possible as you cannot listen to a port in php, which is needed if you want to use the WebSocket for duplex communication)...
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

public class DemoController : Controller
{
    //...
 
    [HttpPost]
    public JsonResult StudentListByFiter(string name = "", int cityId = 0, int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null)
    {
        try
        {
            //Get data from database
            var studentCount = _repository.StudentRepository.GetStudentCountByFilter(name, cityId);
            var students = _repository.StudentRepository.GetStudentsByFilter(name, cityId, jtStartIndex, jtPageSize, jtSorting);
 
            //Return result to jTable
            return Json(new { Result = "OK", Records = students, TotalRecordCount = studentCount });
        }
        catch (Exception ex)
        {
            return Json(new { Result = "ERROR", Message = ex.Message });
        }
    }
 
    [HttpPost]
    public JsonResult CreateStudent(Student student)
    {
        try
        {
            if (!ModelState.IsValid)
            {
                return Json(new { Result = "ERROR", Message = "Form is not valid! Please correct it and try again." });
            }
 
            Student addedStudent = _repository.StudentRepository.AddStudent(student);
            return Json(new { Result = "OK", Record = addedStudent });
        }
        catch (Exception ex)
        {
            return Json(new { Result = "ERROR", Message = ex.Message });
        }
    }
 
    [HttpPost]
    public JsonResult UpdateStudent(Student student)
    {
        try
        {
            if (!ModelState.IsValid)
            {
                return Json(new { Result = "ERROR", Message = "Form is not valid! Please correct it and try again." });
            }
 
            _repository.StudentRepository.UpdateStudent(student);
            return Json(new { Result = "OK" });
        }
        catch (Exception ex)
        {
            return Json(new { Result = "ERROR", Message = ex.Message });
        }
    }
 
    [HttpPost]
    public JsonResult DeleteStudent(int studentId)
    {
        try
        {
            _repository.StudentRepository.DeleteStudent(studentId);
            return Json(new { Result = "OK" });
        }
        catch (Exception ex)
        {
            return Json(new { Result = "ERROR", Message = ex.Message });
        }
    }
 
    [HttpPost]
    public JsonResult GetCityOptions()
    {
        try
        {
            var cities = _repository.CityRepository.GetAllCities().Select(c => new { DisplayText = c.CityName, Value = c.CityId });
            return Json(new { Result = "OK", Options = cities });
        }
        catch (Exception ex)
        {
            return Json(new { Result = "ERROR", Message = ex.Message });
        }
    }
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 190
1 Sergey Alexandrovich Kryukov 180
2 Raje_ 155
3 OriginalGriff 147
4 Mehdi Gholam 120
0 Sergey Alexandrovich Kryukov 8,484
1 OriginalGriff 7,948
2 Sascha Lefèvre 3,199
3 Maciej Los 2,681
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 24 Oct 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100