I have a c# code, I need it to be implemeneted only if the client's browser width is smaller than 1200px

I tried this code:

  $(document).ready(function () {
<input type="hidden" value=""
       name="clientScreenHeight" id="clientScreenHeight" />
<input type="hidden" value=""
       name="clientScreenWidth" id="clientScreenWidth" />
   string height = HttpContext.Current.Request.Params["clientScreenHeight"];
    string width = HttpContext.Current.Request.Params["clientScreenWidth"];
  if(width <1200)
      foreach (var component in leftSideComponents)
          //// Code

but the width returned null.

Is there any one knows how to implement that ?


Related posts

Recent Viewed