Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - Sessions and storing objects -


if return object session (httpcontext.current.session) private member of objects type , modify it, e.g. rename attribute or add objects internal list member. changes persisted if on page request same object session...will updated values updated on previous page. in other words object persisted, or have re-save object session once change on every page. appreciated. thanks

if actual object yes, modifying version maintained session , it's values saved.

if not reference type, string, have reference actual session value modify (ie: session["key"] = value).

however, caution against storing real objects in session. session works serializing , deserializing values on every single page load. more put session more work framework has perform before beginning execute page.

because of how works should put values in session need across entire site.

before considering putting in session ask myself following:

  1. is needed entire site or close it?
  2. is time load information straight database on needed basis more pulling web servers memory?
  3. is site load balanced or has potential of being load balanced in future?

if 1 yes, using session "maybe"
if 2 yes, session maybe, i'd use different caching mechanism.
if 3 yes don't use session @ (and turn off). load balancing requires session state server, sql server. leads initial problem session: namely, values loaded , saved every single page request.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -