Blog » Access StoreId from Codebehind in AspDotNetStorefront

Access StoreId from Codebehind in AspDotNetStorefront

If you’ve ever worked in the codebehinds of the latest versions of AspDotNetStorefront, you’ve probably run into this problem before. Or perhaps you’re smarter than me and already knew this in which case, this isn’t for you. 😉

With the new Multi-Store feature in v9.x of AspDotNetStorefront, there are instances where you need to access the StoreId for one reason or another. The problem is, none of the available classes (this, order, page, etc) seemed to be exposing this value. You could look at this.SkinId but this is not an optimum solution since you can add multiple stores to the same Skin.

What’s the solution? Why, dive into the AppLogic class and you’ll find a method called StoreID() which will return the integer value of the current store. #ForeheadSlap

Have you found a better way to address this? If you have, I’d love to hear about it!

Michael Gibbs
Stalk Me...
Latest posts by Michael Gibbs (see all)