CurrentBrowser within ASPX

Alonso Gonzalez asked on November 5, 2017 16:24

Hi there ,

Is there a way to get the CurrentBrowser object from K# into an .Aspx template ?

Im trying to use it but it get the "CurrentBrowser not present in the current context"

Does anyone know what do I need to import to use it into my .aspx template/class code ?


Correct Answer

Michal Samuhel answered on November 6, 2017 09:17

Hi Alonso,

ASPX templates do not allow to use K# macros in themselves, but you can use full range of our API. So you can either access HttpRequest object with HttpRequest.Browser.Browser and this should provide browser information, or you can use BrowserHelper class like BrowserHelper.GetBrowser().

Both of these can be used within aspx templates and can leverages instead of K# sharp macros(our macros are just wrapping API anyway).

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.