Here's an idea for how you could do it Binding of Isaac-style.
Make an array called 'Map', with width and length set to the maximum width and length of your total dungeon (let's say 9,9). Set the value in the middle (4,4) to "A" - this represents the starting room of your dungeon.
Say "A" always has exits up, left, right and down. You then need to make a bunch of other rooms whose door configurations are represented by letters of the alphabet - "B" could be exits up and left, but not down and right, for example. You can have multiple different rooms with the same exit configuration, so you can name these "B1", "B2", etc.
Then the tricky-ish bit. For your map array, you want to do something like:
For Each XY Element
&Value at CurX, CurY = A
Set value at CurX+1, CurY to choose("B","C","D")&choose"1","2","3"
(where B, C and D are room configurations which all have exits to the left, and you have 3 different layouts for each).
Carry on doing that for the other exits for room A, then carry on for the other rooms. Finally, you should end up with an array that contains all the information you need to auto-generate a dungeon.
Hope that makes sense! I might not have explained it too well - if you like I can put an example .capx together showing the basic idea.