This was McCain's first campaign trip to Nebraska. The Arizona senator, here to raise money for his presidential bid, praised Hagel and declined to talk about speculation that his Republican colleague and fellow Vietnam veteran might be in the running to become Obama's vice president.
Hagel is in the Middle East on a trip with Obama, who is making his first trip to Iraq.
An outspoken critic of President Bush's handling of the war, Hagel has declined to endorse either Obama or McCain.
"Senator Hagel has the deepest respect and highest regard for Senator McCain built over many years of friendship. That will not change,'' said Mike Buttry, Hagel's chief of staff. "Their friendship transcends disagreements on policy.''
McCain is a staunch supporter of the war who traveled Iowa last year in a "No Surrender'' bus.
"Chuck Hagel and I are the dearest and closest of friends,'' said McCain, who toured Werner Enterprises, a Nebraska trucking company, before he went to the Ashland fundraiser.
"I respect his views,'' McCain said. "We've had some disagreements on the Iraq war. But, I'm certainly pleased Senator Obama is being accompanied by Chuck Hagel, who has military experience and who has knowledge of the issues.''
More than 250 people attended the evening event at the U.S. Strategic Air & Space Museum, including former Nebraska football coach Tom Osborne -- whom McCain endorsed in Osborne's failed 2006 gubernatorial run -- and Nebraska Gov. Dave Heineman.
The event drew some of the state's high rollers, who dined on smoked salmon and orangeglazed chicken. Guests included former GOP Senate candidate Pete Ricketts, Lincoln businessman Duane Acklie and University of Nebraska Regent Howard Hawks, chief executive officer of Tenaska Inc.
It cost $1,000 to attend the event, but some couples paid $50,000 to attend a private reception with McCain, while other couples forked over $10,000 to have their picture taken with him.
McCain told those at the reception that he was the underdog in the race and that he wouldn't take Nebraska for granted. He also said he would control federal spending, balance the budget by 2013 and bring Osama bin Laden to justice even if he had to follow him to the "gates of hell.''
He also criticized Obama for opposing off-shore drilling for oil. McCain has said he thinks President Bush's recent decision to allow off-shore drilling has already resulted in lower fuel costs, as speculators and others anticipate America's drilling for new oil fields.
The Nebraska Democratic Party sought to poke fun at the affair with a cookout down the road. The party sold $5 hot dogs, while two of its congressional candidates, Jim Esch of Omaha and Max Yashirin of Lincoln, served up partisan red meat.
"We just wanted to draw a distinction between McCain -- who only seems to be interested in Nebraskans for their money -- and Obama, who has been here three times,'' said Eric Van Horn.
Obama has been a keynote speaker for the Nebraska Democratic Party, attended a rally in Omaha during Nebraska's caucuses and has raised money at a fundraiser sponsored by Omaha investor Warren Buffett.
Hal Daub, who is an old congressional friend of McCain's and a key organizer of his Ashland fundraiser, said the Nebraska Democratic Party's hotdog feed was a political ploy. Obama has raised substantial amounts of money at fundraisers similar to the one held in Ashland, Daub said.
"I don't think they do their own party or their own candidate any good by doing this kind of political ploy,'' Daub said.
McCain's supporters hope his visit will offset Obama's fundraising lead in the state and dim Obama's chances of snagging one of the state's five electoral votes.
So far, Obama has raised more than twice as much money in Nebraska as McCain. The Democrat had collected $365,000 from Nebraskans through the end of May, while McCain got about $155,000.
Obama plans to send paid campaign staff members into Omaha later this summer. They intend to register voters and organize a grass-roots effort in the state's largest city. Nebraska is one of two states that allocate some electoral votes by congressional district.
McCain, in turn, has asked Daub to organize a volunteer effort in Nebraska.
"We're going to work very hard and not take any voter for granted. His coming to Nebraska, which traditionally one might say is a red state that a Republican candidate could ignore, means Senator McCain is saying that every vote is important,'' said Daub, a longtime Republican.