Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

toniperic's avatar

From PHP to ASP.NET

I have to migrate from PHP to ASP.NET and C#. More specifically, I'm trying to get familiar with ASP.NET MVC.

Reading some articles and watching some screencasts, I've seen a lot of similar syntax and concepts as I've seen with Laravel. I guess that's because @taylorotwell came from ASP.NET world.

Are there any great articles or tips for total ASP.NET newbie that has spent years with PHP? Any help would be appreciated, I feel so overwhelmed right now... thanks!

@jekinney tagging you since I think I've read you being into ASP.NET and coming to PHP, so hopefully you'll help me get to the other side. :)

0 likes
6 replies
jlrdw's avatar

Yes on the asp.net site use the drop-down tab that says learn there are many articles and videos at your disposal. I have one site in asp.net and I don't use the MVC I use the razor web pages with c#. I just wrote my own custom classes.

1 like
toniperic's avatar

Is there a path for complete newbie? "Getting started with ASP.NET MVC 4" or "Getting started with ASP.NET MVC 5" means nothing to me, as I don't even know what ASP.NET MVC ultimately is. When clicking on the "Introduction to ASP.NET MVC" I get a too-many-redirects error.

@jlrdw so, where do I start? I feel there's so much to learn, and I don't want to start off the wrong way.

jlrdw's avatar

@toniperic for fun compare these 3 queries:

Older sql server paging query

public string paging(string TableOrViewName, string Columns, string OrderColumn, string OrderDirection, double PageSize, Int32 SelectedPage, string WhereClause)
    {
  return "SELECT " + Columns + " FROM ( SELECT ROW_NUMBER() OVER (ORDER BY " + OrderColumn + " ) AS ROW_NUMBER, " + Columns + " FROM " + TableOrViewName + " WHERE " + WhereClause + " ) AS tmp WHERE ROW_NUMBER BETWEEN " + ((SelectedPage - 1) * PageSize + 1).ToString() + "AND " + (SelectedPage * PageSize).ToString() + " ORDER BY ROW_NUMBER";
     }

LINQ

var owners = (cb.powners
                    .Where(p => p.petowner.StartsWith(ps))
                    .OrderBy(p => p.petowner).Skip(Convert.ToInt32(varoffset)).Take(5)
                    .Select(p => new { p.ownerid, p.petowner, p.ostreet }));

The newer Sql server 2014

var msql = "SELECT * FROM pets WHERE petname LIKE @0 ORDER BY petname OFFSET " + thisoffset + " ROWS FETCH NEXT 5 ROWS ONLY";

At one time long pagination queries had to be written since sql server had no LIMIT clause, but now
there's the OFFSET and FETCH clause.
The LINQ query at runtime is like the long query, LINQ language is a short cut language.
All three are doing the same thing basically. Just thought this was some neat info to share.

2 likes
xsmalbil@icloud.com's avatar

Great stuff. Im starting an 6 month ASP.net job soon as well. Never did anything with it or know what it is.

Please or to participate in this conversation.