Adding attributes to HTML.EditorFor in MVC 5.1

I’ve been adding WAI-ARIA attributes to an ASP .NET MVC site lately (to enhance accessibility of the site) and it lead to some interesting research on how best to accomplish this.

One of the most prominent discussions is an MSDN blog entry from 2012 entitled “ASP.NET MVC: Adding aria-required attribute for required fields” by Stuart Leeks.

Stuart went into moredetail on supplying HTML attributes with EditorFor, and teamed up with his colleague Simon Ince to explain how to add HTML attributes in Templated Helpers such as EditorFor.

Fortunately, I found a better way thanks to a post on how to specify HTML Attributes in an EditorFor by AntonK on StackOverflow.com this December.  He also referenced the portion of the MVC 5.1 release notes where they explain that MVC now allows passing in HTML attributes in EditorFor as an anonymous object.

Here’s an example of how I used it to add an ARIA “aria=required” attribute:

@Html.EditorFor(model => model.City, new { htmlAttributes = new { @aria_required=”true” } })

@Html.ValidationMessageFor(model => model.City, “*”)

Note that the attribute is listed with an underscore, which MVC replaces with a hyphen.

I hope this helps!

Misrepresenting Election Outcomes

In the Dispatch editorial Well done, Mr. Mayor published on December 31st, they referred to “a 2009 ballot issue, in which city residents agreed to raise their income taxes to 2.5 percent from 2 percent”.

While it is true that the 7.3% of voting aged city residents raised their own taxes, they also raised the taxes of the 92.7% of voting aged Columbus residents who did not vote to support the measure – as well as the taxes of tens of thousands of residents who are now taxed under this scheme but were not old enough to vote at the time.

It is important to remember, that one does not need to vote to contribute more money to the City – anyone may give voluntarily. A vote is only required to force your neighbors to pay for the things that you value and they do not.

Saying that “city residents agreed” when only 7.3% did is misleading, careless, and results in continued electoral injustice.

Update: The first calculations were back of a napkin estimates… I’ve tried to make them a little concrete using a spreadsheet based on the election data with 2010 census data to fill the gaps.  Below is a chart of the percentages from that process.

image

Installing Telerik Test Studio on a Server

It makes life easier to have Telerik Test Studio set up such that it is able to run remote tests after a server restart.  Since this isn’t well documented on the Telerik site, I’m sharing my notes here.  Please let me know if you have anything helpful to add.

Installation Instructions

  1. Log in to server with a dedicated testing account.
  2. Run Telerik Test Studio installer – login with testing account.
  3. After installing, under Control Panel > All Control Panel Items > Programs and Features select Telerik Test Studio and click Change.
  4. On the Welcome tab, select the Next button, then click the Change button.
  5. Under Select features, ensure that Storage Service and Scheduling Server are set to Entire feature will be installed on local hard drive.
  6. On the Ready to change screen, click the Change button.
  7. A screen discussing Database Setup may display. This can be closed (I used defaults).
  8. Since this is running on a server, deal with any alerts that object to the browser being used to navigate to the websites being tested. It’s probably a good idea to whitelist internal addresses such as intranet addresses, dev addresses, staging addresses, extranet addresses, and external addresses.
    Note: Be sure to include the HTTPS version of any secure site URLs or the tests for those environments will time out.
  9. Ensure that the testing user account is set to auto-login on machine reboot.
  10. After starting Test Studio on the server; in the system tray, right click Test Studio Test Runner and then click Show.
  11. At the bottom of the Execution tab, ensure Run on start up is checked.

Join me in celebrating “Lysander Spooner Day” on May 14th!

I propose that Americans observe Lysander Spooner Day on May 14th (a Thursday this year).

How?

By refusing any and all un-wanted mail!

I’ll get to the how in a moment, but I think it’d be a fitting tribute because Mr. Spooner thought that the US Postal Service was an unconstitutional monopoly – so he did what any good person would and responded by starting a competing company, the American Letter Mail Company.

The US Government responded to this competition by tying him up in court until he ran out of money and shuttered the company.

Fast forward about 170 years…

I just got done sorting through a pile of unread mail in my home.

It weighed 8.5 lbs (4kg)!

After sorting it into two piles, I found that 86% of the mail was unsolicited junk!

So here’s how to stop it.

The USPS Domestic Mail Manual section 508 part 1.1.3 “Refusal After Delivery” explains that Addressees may control delivery of their mail.

One way to do this is to write Refused near the postage (I’ve used a fat tipped fluorescent pink marker to great effect), then returning it to my mailbox with an indication that there is mail to be picked up.

When the letter carrier arrives, they see the mail piece, read the Refused note, and process it accordingly.

That’s all there is to it – and it takes a lot less of your valuable time and effort to write Refused on a letter (or you can use a Refused stamp) than it does to recycle the mail or throw it away.

Don’t you think that’d be a fitting remembrance for a guy who was bullied by the US Government?  If so, simply share this post with your friends, family, and most importantly – your neighbors!  This protest against Government bullying and junk mail will work best if people participate together.

I propose the hashtag #LysanderSpoonerDay in social media.  Please join me in spreading the word so that Lysander Spooner and the ideas he stood for are remembered across the nation.

All I ask is that you share a link to this page with your friends, and by all means, let me know if you’ll be participating!


Some of you might be wondering, “What happens if I do this for a while – will I get in trouble? Will my letter carrier get mad at me?” For the answer to those questions, I’ve detailed my experience with refusing United States Postal Service junk mail.

My experience with refusing United States Postal Service junk mail

Earlier today I discovered that I had 8.5 lbs. of mail in my house – none of it really important as evidenced by the fact that I ignore it to no ill effect for long stretches at a time – in this case, several months.

I had been refusing my mail using the process described in the USPS Domestic Mail Manual section 508 part 1.1.3 “Refusal After Delivery”.

But how did I get that much junk if I’m refusing it?  Well, I took a break because we added a new member to our family and I honestly didn’t have time to interact with mail at all – not even enough to refuse it.

But I did use this approach before for several months and here’s what happened.

At first, the mail simply disappeared.  This happened for a few weeks.  Then, one day when I wasn’t home, the letter carrier asked my wife a strange question.

Does your husband live here anymore?

My wife suspected something fishy and said that yes, of course I still lived here, and asked him what led to his question.

He said:

Oh, well, we’ve been getting a lot of mail addressed to him that is refused… so we’re going to assume that he doesn’t live here anymore and hold all of his mail.

Seriously? Threats?!? They didn’t like what I was doing so they were going to hold my mail hostage and make me go to their post office to beg for it – no doubt with a complimentary tongue lashing?

My wife responded that the mail man would need to discuss that with me first.

It took me a few days to catch my letter carrier to discuss it with him.

I asked him what the issue was and he explained that my refusal was causing a lot of confusion and frustration at the local post office.

Specifically, he was concerned that it was his sworn duty to deliver every piece of mail with proper postage to my house.

I explained that I did not in any way wish to interfere with anyone’s attempts to do so – only that, as documented in the Domestic Mail Manual, I would be exercising my authority to refuse any mail allowed by the policy.

He said that this left them in a bit of a pickle.

According to him, anything mailed first class would be sent back to the sender – at the sender’s expense (which is an easy way to use market forces to encourage organizations to stop sending junk mail – who wants to pay for useless junk mail?).

That was a hassle for them – but at least they knew what to do with it.

The problem was “bulk mail” that is delivered to everyone in an area as a service of the Postal Service.  Apparently they don’t have a process for returning it – and my junk mail was piling up in the post office.  Worse yet, they have strict policies against destroying or disposing of mail.

His proposal was that I continue to accept delivery of mail as before – and continue expending time and energy processing it as garbage or recycling.

I expressed that I was simply trying to simplify my life, and that while I planned to deal with any requested mail, the junk mail was tantamount to someone stopping by each day and littering in my living room.

I explained that I was unsympathetic to the concern that the perpetrators of this littering would now have to shoulder 100% of the burden for the trouble they’ve caused me and countless other Americans for years.

Since I have nothing against my letter carriers or US Postal Service employees personally, I notified him that I opted out of “bulk mail” and that as a result he would no longer have to shoulder my mail both to my home, and back to the post office after I had refused it.

Unfortunately, he was unwilling to accept my proposal, once again admonishing me that he was bound by sacred trust to deliver every fake foreign lottery winning notice some fraudster felt like sending.

I also explained that, perhaps he could obtain some relief by asking the USPS to amend the Domestic Mail Manual (DMM) or other policies to address his concerns.  It was a real shame that people reading and following the instructions in the DMM were causing so many internal issues – but those were issues between the USPS and it’s employees, and as a customer there was little I could do about them.

Disappointed, he smiled and said that his supervisor would be paying me a visit and I responded by sharing my schedule so she could catch me on a weekday when I was home.

Unfortunately, I have yet to discuss the matter with a supervisor as none have ever attempted to contact me.

So, there you have it… refusing mail in compliance with DMM guidelines may result in threats and attempts to coerce you to stop, but so far I have not explored the limits of adhering to this approach in the long run, so my apologies if it results in less favorable outcomes in your particular case.

How to get Live.com accounts working in Windows 10 Mail Preview

Having trouble configuring your Live.com, Outlook.com or Hotmail.com email address working with the Mail Preview app in Windows 10 Technical Preview builds 10061 or 10074?

Symptoms

When you try to add an account in the Windows 10 Mail Preview app, you have a few options in the Choose an account screen. 

If you select the Exchange option (which lists Exchange and Office 365 compatibility – but none of the legacy free-email domains specifically) it will ask you for your address and take a while before responding with a prompt for your password.

Shortly after entering your password, the dialog box disappears.

Solution

This seems to be an issue for people using two-factor authentication with their Microsoft Accounts.  If so, you’ll need to look up your app password – or create a new one.

After that, simply follow the same steps listed above – but instead of your normal password, use the app password.

After that, everything should work like a charm.

Michael Stinziano Quiz Results

As part of my research into Columbus City Council candidates in the May 5, 2015 Primary, I sent each candidate a list of the questions from The World’s Smallest Political Quiz (WSPQ)

These are the results from Columbus City Council Candidate Michael Stinziano

Note: Since the final question was un-answered, I treated it as disagree due to the way the quiz is scored with 20 points for Agree, 10 points for Maybe, and 0 points for Disagree.  I just didn’t want to skew it by giving points for a non-answer.

Personal Issues

Government should not censor speech, press, media, or internet. – Agree

Military service should be voluntary. There should be no draft. – Agree

There should be no laws regarding sex for consenting adults. – Agree

Repeal laws prohibiting adult possession and use of drugs. –  Disagree

There should be no National ID card. – Agree

Economic Issues

End “corporate welfare.” No government handouts to business. – Maybe

Creating more and better jobs to grow our economy and restore economic prosperity is my top priority.  I am dedicated to creating jobs, particularly to foster small business growth, fund essential services, to help promote neighborhood safety, support our schools, and provide everyone with effective, responsive constituent service.

End government barriers to international free trade. – Maybe

Let people control their own retirement; privatize Social Security. – Maybe

“The devil is in the details” of any plan to privatize Social Security.

Replace government welfare with private charity. – Disagree

Cut taxes and government spending by 50% or more. – NO ANSWER