If you're allowing customers to save YouTube videos on your site and you'd like to extract out the video id when storing into your database you could try using either of these options below.
The thing to remember is that the YouTube url can be either:
and the Video Id can be appended as a querystring parameter or as the last segment of the url:
Welcome to the first issue of Web Developer Monthly. In this month's issue we take a look over the past 30 days to see what has been happening in the world of front-end web development. As this is the first issue, I suspect the format and type of news being covered could vary but lets see how this goes. If you have any comments, good or bad, let me know!
Over the last 3 years I've been working as a senior .net contractor which has meant that I haven't been blogging as much as I'd have liked. To try and fix this and to encourage myself to blog more I'm going to try something a little different and create a monthly blog series that will highlight some of the of the best web design and web development news that has caught my eye over the last 30 days or so.
There are already tons of great daily and weekly web tech feeds out there but sometimes it can feel a bit like information overload. To set myself apart from these feeds I'm not going to list every single news item from the last month. Instead I'm going to pick the 'best bits' from the last few weeks and highlight what I feel are the big hitters. This could include news about asp.net, some JS framework news, TypeScript updates, GIT hints and tips, CodePen.io links or even just some funky UX techniques I've stumbled upon.
Hopefully you'll find it useful. The first issue will drop next month so keep an eye out on Twitter for #WebDevMonthly. If you've spotted anything interesting recently be sure to reach out to me on Twitter to let me know: @RichardReddy
I was recently working on updated an older asp.net 3.5 website to asp.net 4.0. Unfortunately we can't upgrade to 4.5 due to the risk of breaking other sites on the same server. Our reason for the upgrade was really to take advantage of the routing ability that was built into asp.net 4.0 for webforms.
If you're looking for help on setting up .net routing you can take a look at a simple 'how to' for setting up routing with WebForms here that I wrote a few years back.
The issue I was having was that IIS was returning a 404 page not found error when I tried to go to a url without the .aspx. I had setup my global.asax file with the correct routing information but it was like IIS was ignoring these rules.
I usually setup a new solution so that it contains multiple projects. There's a project for web files, data files, services, utilities and so on. When I downloaded and setup Entity Framework through Nuget I installed it into my Project.Web (where all my views/controllers are) and to my Project.Data (where my data context is located with my repositories) projects.
I installed EF Migrations to my Project.Data project as this is where my data context file lives. Everything compiles and run but sometimes when using Entity Framework Migrations I noticed that I was getting an error:
Could not load assembly 'Project.Data'. (If you are using Code First Migrations inside Visual Studio this can happen if the startUp project for your solution does not reference the project that contains your migrations. You can either change the startUp project for your solution or use the -StartUpProjectName parameter.)
This morning I wasted about 4 hours on a bug that turned out to be a browser issue rather than a code one.
When using Chrome I noticed that my datetime validation in MVC was failing. This validation was working perfectly in Internet Explorer and Firefox. So what was going on?
If you ever see this exception error message it might be worth checking out that you're validating the files you're reading into your system to confirm that they are the correct file type. Wasted too much time on this error just now, oy!
One of the multilingual sites I work on was recently converted to Arabic. The site was already running with French, German, Polish and a whole host of others but Arabic was our first right to left language on this particular site.
Once we got the right to left stuff working for our HTML - mostly by using the 'direction' attribute in CSS - we noticed that our code was failing when displaying dates in the system.
This particular error caused me some headaches so I decided to blog about it in the hope that it'll help some other poor soul! I have a pretty standard MVC 3 project that uses Entity Framework Code First for handling the database side of things. I decided to update my project to ensure it was using the latest version of all of the packages in use on my project (ninject/entity framework/etc). This particular project was using Entity Framework v4.1, which I had previously updated using NuGet without any problems, so I decided to download and install the latest version from NuGet - ver 4.2.