Posts

Donate

Run MSI file as Administrator in Windows 8

Hello, Right clicking an MSI file through Windows 8 and then "Run As Administrator" isn't supported. After doing some research, I found some steps to achieve it. See instructions below: 1. Start Button / key 2. Type in "cmd" without quotes and press Shift+Enter to open a command prompt as an administrator. 3. Type in the full path to the msi and press enter. Put the path inside quotes if it has any spaces like "C:\Users\username\My Documents\SoftwarePackage.msi" 4. Press enter and agree to execute the MSI See Reference here: Run an MSI file as Administrator

Unity already has a dependency defined for CommonServiceLocator (VS 2012 Ultimate)

Image
Hello, While trying to add Unity to a Console Project, I encountered an error as stated by the title of this post. After doing some research, I found a post in Stack Overflow which is to update Nuget Package Manager. When I checked my VS, the nuget package manager is an older version. So, I removed/uninstalled it and added the recent version of Nuget package manager through Tools -> Exentsion and Updates then look for Nuget Package Manager. Then install/download it in your VS IDE. See image for current Nuget Package Manager. That's It.. :)

How To Set Transparent Border Color In Internet Explorer 8 And Below Using CSS

Good evening! Normally, the css snippet below paints a transparent border to containers or divs using Mozilla Firefox, Chrome or IE9+. .NewsContent { background-color : #fff; border : 10px solid transparent ; background - clip : content -box; } However, for other IE8 and below, I had a hard time figuring out how to make the border transparent. Luckily, I found a link: Border Color Transparent in IE6 which serves as the basis on how to set transparent border color in Internet Explorer 8 and below using CSS below: .NewsContent { background-color : #fff; border : 10px solid black; filter: chroma( color =black); } Afterwards, the border color changed to transparent. MSDN link: MSDN Chroma Filter :)

Access Is Denied (User.Identity.Name) In ASP.NET MVC

Image
Hi, Given you have an ASP.NET MVC code below that will show the current user logged in a domain: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <div class= "content-wrapper" > <div class= "float-left" > <p class= "site-title" >@Html.ActionLink("your logo here", "Index", "Home")</p> </div> <div class= "float-right" > <section id= "login" > Hello, <span class= "username" >@User.Identity.Name</span>! </section> <nav> <ul id= "menu" > <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home"

Ajax Calls Not Working In Internet Explorer 8

After testing the external js files in IE 8, the calls to post data to a controller does not work. After googling, I found a fix that is to set true to jquery support cors. jQuery Code: 1 jQuery.support.cors = true ; CORS, INTERNET EXPLORER 8, AND XDOMAINREQUEST Cheers!

The file references an XML namespace that is inconsistent with the target framework of the project. (Entity Framework 6)

Good day to all! When adding an ADO.NET Entity Data Model to a ASP.NET project which connects to a certain SQL Server database, the entities (tables) do not appear on the model design view. However, the model successfully connects to the SQL DB.Upon checking the Model design view, an error is shown which is "The file references an XML namespace that is inconsistent with the target framework of the project.". After debugging and re-doing the steps in adding Entity Data Model, the error still persists. Later, I found out that the ASP.NET project target framework was 4.0. Changing it to .NET Framework 4.5 solved the issue . Cheers!

ListView In WPF With Alternating Row Colors

Here's how to alternate the row colors for a WPF ListView control using a Converter class and Triggers. Converter Class: 1 2 3 4 5 6 7 8 9 10 11 12 13 public class AddressTargetConverter : IValueConverter { public object Convert( object value , Type targetType, object parameter, CultureInfo culture) { return ( value .ToString().Equals(parameter.ToString())); } public object ConvertBack( object value , Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } XAML: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 <Window.Resources> <y:AddressTargetConverter x:Key= "AddressTargetConverter" /> </Window.Resources> <Grid> <StackPanel> <ListView ItemsSource= "{Binding PersonCollection}" > <ListView.It

ASP.NET GridView Control CRUD With Bootstrap

Image
Here's a simple CRUD application using ASP.NET GridView control with Twitter Bootstrap as it's css class reference. The code sample used is in VB.NET. Create: Update: Delete: ASPX markup: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 <div id= "Container" > <div id= "GridContainer" > <div id= "LabelContainer" > <asp:Label ID= "lblHeading" runat= "server" Text= "ASP.NET GridView CRUD with Bootstrap (VB.NET)" > </asp:Label>

ASP.NET GridView RowCommand Event Firing Twice

This issue happened when I migrated an asp.net 3.5 website to an asp.net 4.5 website. Upon clicking Add or Delete linkbuttons in the GridView, the RowCommand event fires twice. After googling for hours, I found a solution that is to remove the Handles GridView1.RowCommand in the event declaration. The code below does not work (event fires twice) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Protected Sub GridView1_RowCommand ( ByVal sender As Object , ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) _ Handles GridView1.RowCommand If e.CommandName.Equals( "AddNew" ) Then Dim txtNewName As TextBox txtNewName = CType (GridView1.FooterRow.FindControl( "txtNewName" ), TextBox) Dim cmbNewGender As DropDownList cmbNewGender = CType (GridView1.FooterRow.FindControl( "cmbNewGender" ), DropDownList) Dim txtNewCity As TextBox txtNewCit

Find Checked Treenode In TreeView Control Using LINQ In VB.NET

Here's one way of searching through a treenode using LINQ. Assuming that the search criteria is a List or array object. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Public Class Form1 Public Shared mat As List( Of String ) = Nothing Private Sub Form1_Load (sender As System.Object, e As System.EventArgs) Handles MyBase .Load mat = New List( Of String ) mat.Add( "Books" ) mat.Add( "VB" ) mat.Add( "Drinks" ) mat.Add( "Food" ) mat.Add( "Tea" ) mat.Add( "Chod" ) End Sub Private Sub Button1_Click (sender As System.Object, e As System.EventArgs) Handles Button1.Click If Not (mat Is Nothing ) Then For Each tn As String In mat If (tvMat.Nodes.Find(tn, True ).FirstOrDefault() IsNot Nothing ) Then If (tvMat.Nodes

Donate