Tag Info

Hot answers tagged

7

The underlying issue is not Session or Asp.Net specific, it is a fundamental issue in how collections in statically typed languages work. The Session object is designed to let you store objects of any type. This means the static type of the stored items must be Object. So Session is equivalent to a Dictionary<string, Object>. Since the compiler can ...


4

What you're suggesting is not possible, because the type of the assigned variables cannot be known until runtime. Remember that session is effectively shared between all modules used in creating the page. Some of these may not be known at compile time. Therefore you either need to specify the type, or move the check to runtime by using object or dynamic. ...


2

Session is effectively a map/dictionary with a key that is a string, and a value that is an object. It predates generic types in C#/ASP.Net, and would more likely be an IDictionary<string,dynamic> today, which would support what you are trying to do. //you cannot do this either... //default from a session is an object/null, not even an integer object ...


1

Time on a date-only object is usually midnight. So if you add one to your ending day, you'll get the correct range; it will include the entire last day, up to midnight.


1

Is it easy to call a SOAP web service from an Angular service? No it is usually not possible because browsers are limited to making requests to the same domain as the webpage is hosted unless you apply some CORS. I have never seen anyone try and call SOAP from javascript. If we ignore the security limitations of the browser any credentials for the ...


1

It depends. How is the result meant or expected to be used? If it should be a string (i.e. no associated json semantics), then return it as a string. If you wish to use of the facilities associated with the json data, then keep the JsonResult. If you are unsure, keep the JsonResult and let the client convert it if they require it to be just a string.



Only top voted, non community-wiki answers of a minimum length are eligible