This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<Target Name="SetupCustomAcls" AfterTargets="AddIisSettingAndFileContentsToSourceManifest"> | |
<ItemGroup> | |
<MsDeploySourceManifest Include="setAcl"> | |
<Path>$(_MSDeployDirPath_FullPath)\App_Data</Path> | |
<setAclAccess>Read,Write</setAclAccess> | |
<setAclResourceType>Directory</setAclResourceType> | |
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (SqlConnection destinationConnection = new SqlConnection(connectionString)) | |
{ | |
destinationConnection.Open(); | |
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(destinationConnection)) | |
{ | |
bulkCopy.DestinationTableName = "dbo.BulkCopyDemoMatchingColumns"; | |
try | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creates the script tag | |
var tag = document.createElement('script'); | |
// Calls the API javascript | |
tag.src = "https://www.youtube.com/iframe_api"; | |
var firstScriptTag = document.getElementsByTagName('script')[0]; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var player; | |
function onYouTubeIframeAPIReady() { | |
player = new YT.Player('player', { | |
height: '390', | |
width: '640', | |
videoId: 'jU5i1WjRBhE' | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model Youtube_API_Custom_Video.Models.Video | |
<script> | |
var player; | |
function onYouTubeIframeAPIReady() { | |
player = new YT.Player('player', { | |
height: '@Model.Height', | |
width: '@Model.Width', | |
videoId: '@Model.Id' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Video | |
{ | |
public string Id { get; set; } | |
public string Title { get; set; } | |
public string Width { get; set; } | |
public string Height { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Country | |
{ | |
public Guid Id { get; set; } | |
public string Name { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private List<Country> _countries; | |
public IEnumerable<SelectListItem> CountryItems | |
{ | |
get | |
{ | |
IEnumerable<SelectListItem> selectCountries = new List<SelectListItem>(); | |
selectCountries = _countries.Select(x => new SelectListItem | |
{ | |
Value = x.Id.ToString(), | |
Text = x.Name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IEnumerable<SelectListItem> DefaultItem | |
{ | |
get | |
{ | |
return Enumerable.Repeat(new SelectListItem | |
{ | |
Value = "", | |
Text = "- SELECT -" | |
}, count: 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GenericViewModel | |
{ | |
[Display(Name = "Country")] | |
public Guid SelectedCountryId { get; set; } | |
public List<SelectListItem> CountryItems { get; set; } | |
public GenericViewModel() | |
{ | |
var ddlHelper = new DropDownListHelper(); | |
this.CountryItems = ddlHelper.CountryItems.ToList(); |
OlderNewer