Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. MultiView vs panels

MultiView vs panels

Scheduled Pinned Locked Moved ASP.NET
databasequestionvisual-studioworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Drathmar
    wrote on last edited by
    #1

    For a while now, I've simply used panels, and made them visible=true/false to change the view. However I started playing with the multi view and it seems to have them same functionality and well only one seems to be able to be active at a time. When I was reading about a multi view and read that it loads all controls reguardless of active view. (maybe I misunderstood this part) In my current setup I have: If i have a multi view with three views, or a page with 3 panels. The views would have a gridview, listview, and a details view, and same with the panels. Now due to the nature of these views, I have been using 3 different object sources, one for each. So now comes my question: If I do a multi view, does that mean that every time the page is reloaded, that it will requery the DBF for each of the views? since they are all in existance? (thus, 3 database queries per page load?) What about if a panel that contains a gridview that is not visible. I think that the object is not even sent to the client, and I'd assume that it would not even be created, and thus no object query made. Is that a safe assumption? Lastly, does anyone know a good way to track/count database queries made every time a page is loaded? Maybe a code snip or a log file that could be checked? Drathmar

    M 1 Reply Last reply
    0
    • D Drathmar

      For a while now, I've simply used panels, and made them visible=true/false to change the view. However I started playing with the multi view and it seems to have them same functionality and well only one seems to be able to be active at a time. When I was reading about a multi view and read that it loads all controls reguardless of active view. (maybe I misunderstood this part) In my current setup I have: If i have a multi view with three views, or a page with 3 panels. The views would have a gridview, listview, and a details view, and same with the panels. Now due to the nature of these views, I have been using 3 different object sources, one for each. So now comes my question: If I do a multi view, does that mean that every time the page is reloaded, that it will requery the DBF for each of the views? since they are all in existance? (thus, 3 database queries per page load?) What about if a panel that contains a gridview that is not visible. I think that the object is not even sent to the client, and I'd assume that it would not even be created, and thus no object query made. Is that a safe assumption? Lastly, does anyone know a good way to track/count database queries made every time a page is loaded? Maybe a code snip or a log file that could be checked? Drathmar

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Drathmar wrote:

      If I do a multi view, does that mean that every time the page is reloaded, that it will requery the DBF for each of the views? since they are all in existance? (thus, 3 database queries per page load?)

      Only the active view makes a request to DB, and it's not for all time, basically the control in the active view is filled with data from DB for the first time it displays, and for the next postbacks it is normally recreated from the ViewState instead of DB..

      Drathmar wrote:

      What about if a panel that contains a gridview that is not visible. I think that the object is not even sent to the client, and I'd assume that it would not even be created, and thus no object query made. Is that a safe assumption?

      The object does get created regardless of its visibility, but normally the control with the Visible=false does not bind data, it means it does not make a request to DB. However, if the Visible is set too late in the control life cycle, it still executes the Db query, but does not render.

      Drathmar wrote:

      Lastly, does anyone know a good way to track/count database queries made every time a page is loaded? Maybe a code snip or a log file that could be checked?

      The simple way is to use the SQL Profiler to profile the current DB to see any queries sent to the database when the page is loaded. In addition, you can use your code or any library out there like log4net to log any calls that are made to your data access code.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups