Monday, October 10, 2016

CSS Responsive Videos

Again, these are old tricks but new to me as I get back into developing new sites rather than supporting Telerk based ones.  In the previous post I shared a CSS snippet on how to make images responsive.  Now onto video.  A lot of sites offer ways for you to copy some code that allows you to paste their videos into your various web sites.  Many use iframes to do this which can be a little problematic.

The following CSS snippet works for youtube videos at least.  I just take whatever copy/paste code form a given site that allows me to embed things and wrap it in a div with the class "vid".  Here is the CSS.

 .vid {  
   position: relative;  
   padding-bottom: 56.25%;  
   padding-top: 30px;  
   height: 0;  
   overflow: hidden;  
   .vid iframe, .video-container object, .video-container embed {  
     position: absolute;  
     top: 0;  
     left: 0;  
     width: 100%;  
     height: 100%;  

This seemed to work.  More information [HERE].

Getting the Strong Name PublicKeyTolken from an Assembly

[Update, if this doesn't work check the bottom]

Ok, this is .net 101, but I don't update assemblies that often so here is a recap of it so I remember in the future more for me than for you.

1) First, go the the assembly, right click it, get the details, write down the version number, that is probably old too.

2) Since you have the file open, copy it's path, then open up a Visual Studio command prompt.  Type in

sn -T (paste your path)\yourassemblydll

And it should output a new/correct PublicKeyTolken.

Copy and paste the new version and the new PublicKeyTolken text into your config file.  That should do it.

More info on this [HERE].


Well, this used to work all fine and good, but didn't work on a new machine that I have that just had visual Studio 2015 on it.  Here is what I had to do.

1) Navigate with file explorer to where the sn.exe file is located, for me it was here-
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools.  Copy that that path then open the Visual Studio developer prompt.

2) type cd then past the path in, hit enter.

3) Next, get the path to your dll that you want to get a strong name for.  Also write down the detail information like in step 1 in the old way above.

4) In the command prompt type sn.exe -T and hit enter.

That worked for me.

Thursday, October 06, 2016

CSS Responsive Images

This is an old trick but I didn't know it.  Here is how to make your images auto scale-

 img {  

More [HERE].

Also check out the new picture HTML 5 element [HERE].