This post originated from an RSS feed registered with .NET Buzz
by David Cumps.
Original Post: Differences between PHP and ASP.NET
Feed Title: David Cumps
Feed URL: http://weblogs.asp.net/cumpsd/rss?containerid=12
Feed Description: A Student .Net Blog :p
In response to a thread on the ASP.NET Forums I decided to publish the answers in an overview on my blog.
Someone asked on what the difference were between PHP and ASP.NET and how he did certain things.
My answers are based on using C# as the language for your ASP.NET application.
__________________________________
1. Is there any difference between '' and "" in ASP.NET?
Yes, ' ' is used for characters while " " is for strings.
Take this for example: 'a' = a in memory "a" = a and \0 in memory
Something usefull about escaping in ASP.NET is the following: @"bla\bla" == "bla\\bla"
A string with an @ in front of it is seen as a literal, where you don't have to escape special characters.
2. How would I do something like: print $variable.'string'; in ASP.NET?
You would use the following: Response.Write(variable + "string"); But it isn't very recommended to use Response.Write, take a look at all the server controls you have, like a Label for example.
3. Within an if language construct, what would be the equivalent of "and" and "or?"
Actually PHP supports the same being used in ASP.NET: