In a meeting with Mr. Trump in the Situation Room Wednesday morning, seven House Republicans and seven Democrats who are members of the Problem Solvers Caucus told Mr. Trump that they were eager to have a bipartisan discussion with him about border security, among other matters, but that he needed to first sign legislation to get government funding flowing again.

“Both sides listened to each other, and believe that there’s a way forward,” said Representative Josh Gottheimer, Democrat of New Jersey, who attended the session. He called it a “productive conversation,” but added, “It’s critical that we reopen the government first, for our safety, our security, our economy.”

Sarah Huckabee Sanders, the White House press secretary, called the meeting “constructive,” and said, “They listened to one another, and now both have a good understanding of what the other wants.”

Another attendee who insisted on anonymity to describe the private discussion said neither side considered it a negotiating session, and Mr. Trump did not embrace the idea of reopening the government before the border barrier issue was settled. The president began the session with an extended talk about what he described as the crisis at the border, while lawmakers told him about the effects of the shutdown on their districts.

In the Senate, a group of Republicans and Democrats was also working to persuade the president that no progress was possible as long as the government remained shuttered. It circulated a letter that called on Mr. Trump to drop his demand for wall funding as a condition of ending the shutdown, urging him to agree to sign a three-week stopgap government funding measure to allow time to forge a “broad bipartisan agreement” on border security spending.

“We commit to working to advance legislation that can pass the Senate with substantial bipartisan support,” said the letter, which was spearheaded by Senators Lindsey Graham, Republican of South Carolina, and Chris Coons, Democrat of Delaware. “During those three weeks, we will make our best efforts following regular order in the appropriate committees and mark up bipartisan legislation relating to your request.”