Minnesota Web Developer | A little something about everything...

Minnesota Web Developer

A little something about everything...

How to show/hide a asp.net sub element with jquery

This method allows you to show/hide a form element without making another request against the server. It also works when the show/hide element is required by the asp.net code behind.

You can use any type of sub element under a dropdown with this script. You will need to use a CDN or download and host your own jquery-1.3.2.min.js file.

SCRIPT

<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script> <script type="text/javascript"> $(function() { $('#<%= Dropdown1.ClientID %>').change(function() { if (this.value=="My Value") { $('#<%= Element1.ClientID %> ').css({ visibility: 'visible' }); } else { $('#<%= Element1.ClientID %> ').css({ visibility: 'hidden' }); }}); }); </script>

 

HTML

<asp:DropDownList runat="server" ID="Dropdown1" class="required" >
<asp:ListItem Value=""> none</asp:ListItem>
<asp:ListItem Value="My Value">Some Text Here</asp:ListItem>
</asp:DropDownList>

<!-- place any element here with id="Element1" -->

text-shadow not working in chrome, css tricks

Here is the sample,

Text Shadow

And with no further adieu, here is the code:

for chrome:

  • text-shadow: -3px 3px 2px rgba(0,0,0,1);

For MS Browsers:

  • text-shadow: -3px 3px 2px 1px rgba(0,0,0,1)

For Both:

  • text-shadow: -3px 3px 2px rgba(0,0,0,1)
  • text-shadow: -3px 3px 2px 1px rgba(0,0,0,1)
Since CSS is read top down you can just place the version needed for crome above the general use/preferred method.

Change Style for Multiple Elements onClick: getElementById, getElementsByClassName, querySelectorAll oh my

With a bit of creative javascript and these Methods you can do some pretty neat stuff.

On this page I've create an example for multiple elements display block/none function based onclick function. You could also utilize checkbox.checked, onmouseover, or other such functions.

You can replace querySelectorAll with getElementsByClassName or getElementById for broader browser support or you can simply create a detector onload to look for an element on the page and hide it if the Method is supported with querySelector like this:

window.onload = function(){
 document.querySelector('#compat').style.display = 'none';
    }

The Code:

HTML

<div class="aa" style="display: block;">class: aa, no id</div>
<div class="aa" id="aa" style="display: block;">class: aa, id: aa</div>
<div class="bb" style="display: block;">class: bb, no id</div>
<div id="aa" style="display: block;">no class, id: aa</div>
<a onclick="showClass('.aa');" href="#">Looks for class: aa</a>
<a onclick="showClass('#aa, .bb');" href="#">Looks for class: bb, and id: aa</a>
<a onclick="showClass('.aa, .bb');" href="#">Looks for class: aa, bb</a>
<div id="compat" style="display:block;position:absolute;width:100%;height:100%;background-color:#fff;top:0;left:0;padding:50px; "><h1>Compatability Error!</h1>
<p>This page uses newer coding technologies. You should consider upgrading your browser.</p>
<p>for suggestions, please go <a href="http://outdatedbrowser.com/en">here</a>.</p>
<a href="#" onClick="document.getElementById('compat').style.display = 'none';">Continue Anyways</a>

Javascript

function showClass(s){
 var e = [];
 var e = document.querySelectorAll(s);
 for (var i = 0; i < e.length; i++){
    if(!e[i])return true;

    if(e[i].style.display=="none"){
       e[i].style.display="block"
    } else {
       e[i].style.display="none"
    }
 }
 return true;
}

Use your imagination and see what you can do with it.

Here is a working example:

class: aa, no id
class: aa, id: aa
class: bb, no id
no class, id: aa
Looks for class: aa Looks for class: bb, and id: aa Looks for class: aa, bb

Compatability Error!

This page uses newer coding technologies. You should consider upgrading your browser.

for suggestions, please go here.

Continue Anyways

Government approved unlimited debt ceiling until February 7, in order to reopen the US government spending spree.

In a sad display of bi-partisanship our elected officials decided not only to increase the debt limit but to remove all spending limits until February 7th of 2014. With a record low approval rating the only thing that they have been able to agree on is that they want to spend more of your money. It may be time to clean house if we want to keep the US economy above water in the next few decades.

Do we really need 2.65 million federal employees?

Does the federal government really need 2.9+ Trillion of our money in 2013?

More spending means more taxes, in one form or another.

 

 

 

 

VPN setup for Windows Server 2012, How to:

VPN Server Setup in Windows Server 2012

 

Simple walkthrough of the steps you need in order to accomplish this are as follows:

  • Open Server Manager > Add roles and features > Next > Choose (default) role based or feature based > Next
    • Select the server you would like to install VPN services to > Next
    • Select Remote Access Role > Add features > Next > Next > Next
    • Choose (Default) DirectAccess and VPN (RAS) > Next > Next > Next > Install > Close
  • In Server Manager select Remote Access > Select more on the right of the configuration notice or select from you pending tasks
    • Select open getting started wizard if you choose the first method.
    • Select Deploy VPN Only
    • Once the Routing and Remote Access MMC is up right click the Server and choose "Configure and Enable Routing and Remote Access". > Next
      • Select Custom > Next > VPN Access > Finish > OK > Start Service
    • right click server and choose properties
      • Select IPV4 tab to configure IP Pool or leave it Dynamic
  • From Computer management or Active directory you will need to create a group or modify each user you would like to have access to the VPN
    • right click user > properties > dial-in tab > allow access > apply > ok

You should also properly setup you VPN security if you have any critical data being transmitted via this network. For assistance with this you can contact a professional IT company like Area51.mn to assist you with proper setup and network security.