I need a simple 'Yes/No' modal dialog for a SharePoint web part, and I do not really want to re-invent the wheel here. SharePoint uses some very nice modal dialogs for this purpose, is it possible to re-use them, instead of creating a litter of little aspx pages for the ShowModalDialog() function
You actually don't have to use dialog.master, as that by itself doesn't help you use the 2010 dialog framework. the default.master works just fine because it has CSS that hides the ribbon bar, navigation, and other UI components that you don't want in a dialog (...unless you explicity expose them).
Hope that helps...please don't hesitate to ask ant follow-up questions you have.
Yes, you can reuse them. It's all about using the .master file that SharePoint ships. Master page like dialog.master are designed for pages which are displayed in popup and you should reuse them rather than writing your own. It comes with OK and Cancel buttons and placeholders in which you can place your content. In your page you will have to refer them with MasterPageFile attribute because they are not in master page gallery.
And in your code behind, you can wire the code on click of "Ok" button like this:
You can change the Text property of OkButton to "Yes" and Cancel button to "No" if that makes sense in your case.
Reusing Popup Dialogs As far as reusing is concerned, you can use query string parameters to manipulate the content on the page. For example, with yes/no button you typically display a message. you can store the message in resource files and pass resource key in query string to the aspx dialog page to display different message.
Also if you think you can reuse existing sharepoint dialog box, you can examine the query string parameters it expects and send your own parameters and use sharepoint's popup pages.