Kevin O’Holleran managed Mark Herring’s campaign for Virginia attorney general.

Political conventional wisdom has it that in a purple state, such as Virginia, support for gun-safety legislation is best played down. As manager of Mark Herring’s campaign for attorney general, I got a lot of advice. One of the things I heard most frequently was that we should soft-pedal his strong record and advocacy for sensible gun legislation. It would hurt us outside of Northern Virginia and wasn’t a voting issue within the Beltway, I was told.

Like much conventional wisdom, this was wrong — and we not only ignored this advice but did the opposite. There were stark differences between Herring and his Republican opponent, Sen. Mark D. Obenshain (R-Harrisonburg), on gun safety. Obenshain opposed comprehensive background checks and opposed closing the gun-show loophole. He opposed former governor Douglas Wilder’s landmark “one-gun-a-month” legislation. Obenshain also made a habit of voting for such irresponsible proposals as allowing guns in bars and restaurants where alcohol is served.

In short, Obenshain has opposed every constructive proposal to help reduce gun violence.

We knew this would open an opportunity for us to draw an effective contrast; public polling showed widespread support for sensible gun-safety laws, as did our own polling. Hence, more than a year out from Election Day, dealing with gun violence was a fundamental messaging point for Herring. And when the primary was over, and Herring and Obenshain met in their first debate, he drew a sharp contrast with his opponent on guns. We would prosecute that case throughout the fall campaign.

Obenshain’s position against gun-safety legislation was standard GOP fare — but it reflected a state and a voter mind-set that no longer exist. Almost all Virginians support sensible gun-safety legislation. Over the years, the commonwealth has become more urban and suburban, not only in Northern Virginia but also in Norfolk and Richmond. We found broad support in the Washington suburbs, Richmond and Norfolk for comprehensive background checks and ending the gun-show loophole.

Campaigns must make difficult financial choices, and in the general election, we knew we were going to be outspent by as much as three to one. We also knew that two issues would be powerful to voters: gun violence and Obenshain’s extremist views on women’s health issues. We couldn’t afford to focus on both simultaneously, so we started our television campaign on Obenshain’s record on women. Our intent was to start with these issues, broaden the offensive and eventually close by focusing on Obenshain’s record of inaction, or worse, on gun violence.

Ultimately, we never stopped talking about Obenshain’s abysmal record on women’s health. Independence USA, the super political action committee started by New York mayor Michael Bloomberg, and Americans for Responsible Solutions, the organization founded by former representative Gabrielle “Gabby” Giffords and her husband, Mark Kelly, joined the race in the closing weeks, running commercials that discussed gun violence issues.

The National Rifle Association ran commercials against Herring, but its messages were directed at voters who our own polling showed were never accessible to Herring. The NRA avoided the largest concentrations of swing voters in the Northern Virginia, Norfolk and Richmond markets. That is not a recipe for growth or success.

The swing vote began to shift dramatically in our favor at the end. When the ballots were counted in Northern Virginia, Herring not only beat Obenshain there by more than 100,000 votes, but he also increased the total Democratic vote in Northern Virginia for attorney general by more than 124,000 since the last election. A post-election survey of voters in Northern Virginia by the Global Strategy Group indicated that 57 percent of those who voted for Herring in Northern Virginia believe gun issues had a major impact on the way they voted.

This massive increase wasn’t just about the mechanics of campaigning. The painful and numbing record of senseless gun violence — from Columbine High School in Colorado to Virginia Tech to Newtown, Conn., and, during the heart of the fall campaign, the Navy Yard shooting — was the real determinant of voters’ sentiments. Our campaign pointed out the contrast, and voters lined up on our side. Even the NRA’s active opposition in its home state could not change the fact that voters rejected our opponent’s radical position on gun safety. Those perpetuating the conventional wisdom should take notice: In the end, voters were calling out for action on gun violence, and they flocked to the candidate who offered progress and a sensible, mainstream approach to protecting Virginians.

Read more about this issue:

Dana Milbank: After Navy Yard shooting, RIP for gun control

Fred Hiatt: Searching for the tipping point on gun control

Robert J. Spitzer: Five myths on gun control

E.J. Dionne Jr.: The Colorado recall’s morality lesson on guns

Eugene Robinson: Stop the gun madness