??? Will the sidebar be *PART* of the ASP.NET page or will it be an <iframe> and so semi-independent of the page?
If it is part of the page, why is there even a question? The category of the page is "shoes" so you simply use a SQL query that gets all subcategories of "shoes". If the category is "pants", you get subcategories of "pants".
All this means is that your DB design has to be correct, so that your SQL statement becomes
String SQL = "SELECT * FROM subcategories WHERE category = " + currentPageCategory;
(tha't's C#. VB.Net nearly identical)