Hang in there :)
I can't really give you much advice on the ASIO4ALL pieces of your puzzle, because I got rid of it about 8-9 years ago (yikes), but I can suggest the midi and audio track routing assignments for an experimental track for you to try to get sound out (at least as far as the assignments for the tracks anyways):
Please try the following:
1. Start a brand new project, with the Normal template, and give it some Test 01 sort of name.
2. If the console view is open, just for the moment close it, by hitting the X in its lower left corner (I think that is where it should be for console view). This is just to free up space to work in the Track Pane.
3. OK, now in the blank space on the left side of the Track Pane, right-click, and Insert an Audio Track. then also right-click again, and Insert a Midi Track. (we will come back to these in a short bit)
4. OK, now, in the Browser Pane (right side of the screen), click on the button labeled Synth, then click on the '+' sign - to Insert a Synth. Go through the list of the VST2 synths, and select one of your Kontakt versions - doesn't matter which of them you pick for now. When the Insert Soft Synth Options dialog box opens, for purposes of this little test, remove any checks for any of the Create Tracks options (since we already created our own audio and midi track), and Check the boxes: Synth Property Page, Synth Rack View, and don't worry one way or the other about the ones at the bottom (Enable Midi Output, Recall Assignable Controls). I would also suggest you leave the box checked for Ask This Every Time, so that you can get these options to open for future iterations of adding soft synths. Anyways, after you click on OK, you should get the Kontakt synth property page to open up.
5. OK, so load up one instrument into Kontakt - let's use the Kontakt Factory Content>Band>Electric Piano>Mark I Classic.nki instrument. By default, Kontakt will load this instrument and set its audio outputs to outputs 1/2, and the midi channel to 1. So, these settings are fine. We still don't have things hooked up to our tracks, but we are about to fix that. Close the Kontakt property page.
6. OK, so, click on the number (1), on the left side of the audio track (should be track 1), to bring that track into focus. In the Inspector Pane, it is probably pre-selected for Pro-Channel (ProCH will be blue) at the top of the inspector pane. Click on that button labeled ProCh, to get rid of that display, and then you should see a channel strip for track 1 (your audio track) on the left, and then the Master Bus on the right.
7. So, at the bottom of the track 1 audio track's channel strip, click on the drop-down arrow for the Input selection, to set what audio this track will be fed from, and select the Kontakt stereo output for 1/2. (should be the 3rd one down in the list, once you expand the Kontakt list of inputs). This will tell Sonar to take any audio output from the Kontakt instance's main outputs and feed it to track 1's input. Leave the Output for track 1 to go to Master.
8. Now, we have to assign things for the midi track (track 2). Click on the number on the left side of track 2 (should be a 2), to bring the midi track into focus. (actually, in this case, it should default to set it up for you, since it is the only synth, so it should assign it already for you, but we will look)
9. OK, at the bottom of the midi track's channel strip in the inspector pane, you should see the Output already set to your Kontakt instance. This is what you want here. Later, as you add more synth instances, you will need to click on the drop-down arrow and select the correct synth instance for what you want that midi track assigned to, but for this test, leaving it to the default Kontakt instance is just what you want. Set the midi Input to: 'Input = All Inputs: Omni'.
So, after all of the above, which takes longer to type than to do, you should have a loaded instance of Kontakt, with an instrument, assigned to the Kontakt main outputs, and set to receive midi triggering data on midi channel 1, for an electric piano sound.
You should also have an audio track set to send any audio generated by the Kontakt main audio outputs, to the Master Bus, and you should have a midi track that is set to send any midi data it detects, to the Kontakt instance.
Now, since you had already brought the midi track (track 2) into focus, by clicking on the number 2 on the left side of that track, you should also see (by Sonar default) that one of the buttons is Blue on the midi track, and if you hover your mouse over it, it will say 'Input Echo = Auto Through' which is just what you want - Sonar will automatically set that track to monitor the output from that Kontakt instance, which you will hear through the audio track (because the audio track is set to pick up any audio output from that Kontakt instance).
Soooooooo, when you play notes on your keyboard midi controller, with Track 2 (the midi track) in focus - and the Input Echo lit Blue, the midi note events will get detected by the Kontakt instance, by the loaded instrument (electric piano), and then Kontakt will process those note events in that instrument, and it will send audio output back out through the Kontakt instance's main outputs. That audio output from Kontakt is assigned to your audio track (track 1), as input to that audio track, and then the audio output from track 1 gets routed to the Master Output.
If all is done properly above, you should be hearing electric piano sounds when you play, and if you arm the midi track (track 2) for record, and hit the red record button on the transport control in Sonar, then play some midi notes on your keyboard midi controller, Sonar should record that midi data, and you should be able to hear it during playback.
It's a starting point, and there are other ways of doing things, as there usually are, but it SHOULD give you some sound, so if that does not happen after completing the above steps, then we need to look at your Sonar Driver Mode, and the audio drivers, and all of that stuff, which is also part of that puzzle to figure out.
I will try to help you, as will others.
At SOME point, regardless, I recommend you consider picking up a purpose built audio interface with proper ASIO drivers for Windows, but maybe we can get you up and running in the meantime. :)
Bob Bone