The main way in which you can prevent an asthma attack is by writing down exactly what it is that triggers your asthma off. Whenever you feel the start of your asthma coming on, write down the following:
What were you doing at the time?
What was around you (i.e. animals, people, other environmental factors)
Where were you?
By answering these questions you will get to know whether there is a pattern with your asthma attacks and whether there is anything specific that sets off your asthma. Once you know what your triggers are you can then avoid the situation which puts you near those triggers. For example, if your trigger is dust then cleaning may not be an excellent idea! If your allergy is pet related then you would be better off staying away from all pets. By avoiding the triggers you are less likely to have an asthma attack.
If your asthma tends to come on when you do exercise or a lot of physical activity then it may be a good idea to warm up first and build up your exercise. So do not start out too vigorously, start off slowly and allow your body to get used to the change in activity. That way you really will lower your risk of having an attack and you could also build up the strength of the airways which would prevent future attacks too.
Yoga is also said to help a little with asthma so if you haven't tried that yet then it may be worth looking into. Sahaja yoga in particular has been found to help with moderate to severe asthma.
Overall there are ways in which you can prevent an asthma attack and the best one is to avoid whatever it is that causes the attacks to come on.