When your landlord breaks the law (© Comstock/Getty Images)

See if you can nail this question: One day the heat goes out in your apartment, and your landlord brings over a space heater. Do you: a) thank him; or, b) ask when the heating system will be up and running again?

Polite or not, the answer is "b." You can dole out a quick thanks for the heater if you like, but make sure all sides are clear: This is a temporary fix only.

Too many tenants fail here, unaware that by law the landlord must repair the primary heating unit — and air conditioning and major appliances, etc. — swiftly. Failure to do so breaches the rental contract and poses a safety risk.

So why is this critical for the tenant to know? Shouldn't the landlord know this? Isn't someone watching the landlord?

There's the problem: Many landlords aren't aware of their legal responsibilities, tenant advocates say. It's not as if landlords need a license, and no one is randomly checking up on them. Housing officials respond only if you, the tenant, call — and even then they're likely to ask, "Did you notify the landlord?"

Welcome to the world of renting, where it's up to you to be on alert. If something seems amiss or unfair, that's the time to ask, "Is my landlord breaking the law?" (See "How landlords get away with it")  If you think the answer might be yes, document the incident and, if necessary, contact a tenants association.

Housing laws vary from state to state, and even from town to town, but the basics tend to apply everywhere. For some ideas of what these look like, here are seven examples. See if you know the answer: "Is that legal?"

1. It's just a friendly little conversation — or is it?
You make an appointment to view an apartment. When you arrive, with your child in tow, the manager smiles and says, "Oh, I didn't realize you had a child. I'm concerned about safety; the fence around the pool is not secure."

Is the landlord violating federal anti-discrimination laws?

The answer's a little messy. Words alone don't break laws, unless you scream, "Fire!" in a crowded movie theater and cause immediate harm. But if that landlord rejects your application and leases to a childless person, you may very well get a friendly reception from a housing lawyer and a judge.

Under federal law, landlords cannot choose tenants based on familial status, age or health.

But many landlords either don't know this or believe they can subtly dissuade those people from applying. They might say to a parent or an older person: "Are you sure you'd want to deal with these stairs?"

"We routinely see this," says Adam Murray, executive director of the Inner City Law Center in Los Angeles.

"They will say, 'Oh, you have kids, I didn't realize that when you called. I really want to rent to single folks.' Or sometimes it's couched: 'I don't think the building is safe for kids.'

"Routinely, landlords will say this, and often they don't know," Murray says. "The question is: Is the landlord discriminating on that basis? The law is pretty clear — you can't not be renting to someone on the basis of that."

2. Locks changed? What do you expect when you don't pay the rent?
You are 30 days late paying the rent. The landlord has asked again and again for the money, and you still have not paid what's owed. Finally, the landlord changes the lock so you cannot enter, forcing you to either come up with the cash or leave.

This happens more than people realize, tenant advocates say, and it is a blatant violation of the law.

Even in Arkansas — one of the most landlord-friendly states in the nation — it's not OK for landlords to change the locks without going to court first and obtaining a judge's order.

"I have landlords all the time who will resort to strong-arm tactics and bullying tactics, where they will tell a tenant, 'I'm going to come tomorrow and I'm going to change the lock,'" says Dylan Potts, a landlord-tenant lawyer with Gill Elrod Ragon, in Little Rock, Ark.

Potts has even seen leases in which a tenant pre-authorizes the landlord to come in and change the lock if the tenant is three days late, for example.

What's your home worth?

"Even with the contractual term, that is void and against public policy," Potts says. A landlord can't write around the law. (See "Renters: Beware of these lease clauses.")

Tenants are routinely removed this way, he says. The problem is that tenants don't know their rights, and usually can't afford legal counsel. They think their only option is to leave.

Landlords, meanwhile, are surprised to learn that self-help eviction, as it's called, is not legal.

"I think the landlord, as the owner of the property, feels like he has the right to remove someone from the property if that person is not obliging with the terms of the contract," Potts says. But a judge and, later, police must carry out the eviction process.

"There has to be a sense of order in this process, and by giving the landlord total control, you strip the tenant of all potential defenses that the tenant may have to contest that type of eviction," Potts says. "It puts all the power in the landlord's hands to make all the decisions."

3. Your stuff? Sorry, it's not your place anymore
So the landlord got an order from a judge and legally changed the lock. If you weren't there, it's your tough luck if your possessions are inside his unit, right?

If you're getting the hang of this exercise, you may have guessed: The landlord most likely needs to make some effort to contact you. He can't help himself to the television because you owe him money. He can't toss your clothes on the sidewalk because he needs to clear the apartment and you didn't show up within 24 hours of the eviction date.

"The typical requirement is the landlord must go back to court if there is property maintained there by the tenant," Potts says. "There are landlords that will dispose of those possessions. My advice to landlords has always been to store the possessions."

Yes, after a reasonable amount of time, and after effort has been made to contact the former tenant, the property may be considered abandoned. A tenant can't reappear months later and try to claim his belongings.

But if a tenant was evicted only days or weeks before, or if he still legally resides there but has not paid the rent, the landlord cannot lay claim to his possessions.

"I see this tied a lot to the initial self-help eviction," Potts says. "There's no sheriff, no court. They go in and change the locks themselves, hold the stuff hostage, then bargain with tenants."

What's a tenant to do? Get help, the experts say.

"Any time anybody's getting evicted, they should be seeking legal assistance," Murray says. "There's a study that shows if you don't have an attorney, you're likely to lose.

"And on the landlord side, most will have an attorney. So you have a real mismatch of understanding what the rules are," he says. "It's not enough to just know these things."