0

I am working on ASP.Net 4.5

I have a control which I don't want to load or do not want to render the elements for mobile view, Below code is working fine, But the problem is it is loading the control and hiding it, which I don't wan , Can I avoid loading of my control in mobile view?

Below is my aspx Page

<div class="hidden-xs">
    <CC2:MegaMenu ID="MegaMenu1" runat="server" ></CC2:MegaMenu>
</div>
Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Parshuram Kalvikatte
  • 1,616
  • 4
  • 20
  • 40
  • Do you have any flag or any other way to know in server side if you're in *mobile mode* or not ? – DontVoteMeDown Jan 25 '18 at 11:59
  • No i dont have that only by bootstrap visble xs class i used – Parshuram Kalvikatte Jan 27 '18 at 07:57
  • As a quick suggestion, I would tell you to use something to check if user is actually using a mobile device([example](https://stackoverflow.com/a/15150381/1267304)), like in the login for example, and store it in a key on the session to rely on and use to make decisions as that one you're requesting. – DontVoteMeDown Jan 29 '18 at 10:56

0 Answers0