Click here to Skip to main content
15,886,873 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Help with a connection string Pin
Wombaticus10-Nov-15 1:09
Wombaticus10-Nov-15 1:09 
AnswerRe: Help with a connection string Pin
Richard Deeming10-Nov-15 1:21
mveRichard Deeming10-Nov-15 1:21 
GeneralRe: Help with a connection string Pin
Member 1212435410-Nov-15 12:28
Member 1212435410-Nov-15 12:28 
GeneralRe: Help with a connection string Pin
Richard Deeming11-Nov-15 1:54
mveRichard Deeming11-Nov-15 1:54 
GeneralRe: Help with a connection string Pin
Member 1212435411-Nov-15 11:59
Member 1212435411-Nov-15 11:59 
QuestionJquery Ajax method call with asp.net static webmethods Pin
ganesh.dks8-Nov-15 20:31
ganesh.dks8-Nov-15 20:31 
AnswerRe: Jquery Ajax method call with asp.net static webmethods Pin
Nathan Minier9-Nov-15 2:53
professionalNathan Minier9-Nov-15 2:53 
GeneralRe: Jquery Ajax method call with asp.net static webmethods Pin
F-ES Sitecore9-Nov-15 4:49
professionalF-ES Sitecore9-Nov-15 4:49 
Nathan Minier wrote:
If you have a static method on a non-static object, an instance WILL be created by the ASP.NET host in order to process the request, therefore any constructor logic will fire. The static signifies that the method (or field, or object) will only be created once, and all calls made by the application for that static element will point to the same memory address space.

An instance won't be created. If you call a static method on a type that has not yet been loaded into the app domain then the type is loaded. If that type has a static constructor the static constructor will be called. Once a type is loaded into the app domain it will remain, so the next time you call a static method on that type the static constructor is not called again as the type hasn't been loaded as it has been previously loaded.

Talking specifically about the context of the problem, if you have a page that serves controls etc, and also houses static methods you call via ajax then the type will already have been loaded in order to serve the page (and it is at this point the static constructor is called, and then the non-static constructors for the specific instance of this page) so your static methods will already be available in the app domain, so calling them won't even trigger the static constructor.

Nathan Minier wrote:
By leveraging statics, you introduce state to an object.


I disagree. If your static methods use static variables then you are creating "state" (albeit "global" state), but using static methods on their own does not introduce what would be considered state in this context.
GeneralRe: Jquery Ajax method call with asp.net static webmethods Pin
Nathan Minier9-Nov-15 6:05
professionalNathan Minier9-Nov-15 6:05 
GeneralRe: Jquery Ajax method call with asp.net static webmethods Pin
Richard Deeming9-Nov-15 9:04
mveRichard Deeming9-Nov-15 9:04 
GeneralRe: Jquery Ajax method call with asp.net static webmethods Pin
Nathan Minier19-Nov-15 1:23
professionalNathan Minier19-Nov-15 1:23 
AnswerRe: Jquery Ajax method call with asp.net static webmethods Pin
F-ES Sitecore9-Nov-15 4:59
professionalF-ES Sitecore9-Nov-15 4:59 
QuestionASP.NET MVC How to implement timer functionality to update dock panels on client side respective to their time intervals? Pin
glitteringsound4-Nov-15 20:41
glitteringsound4-Nov-15 20:41 
AnswerRe: ASP.NET MVC How to implement timer functionality to update dock panels on client side respective to their time intervals? Pin
Nathan Minier5-Nov-15 1:37
professionalNathan Minier5-Nov-15 1:37 
QuestionMVC View and Sub Views, Child View? Views within a View? Pin
jkirkerx4-Nov-15 7:38
professionaljkirkerx4-Nov-15 7:38 
AnswerRe: MVC View and Sub Views, Child View? Views within a View? Pin
F-ES Sitecore9-Nov-15 5:11
professionalF-ES Sitecore9-Nov-15 5:11 
GeneralRe: MVC View and Sub Views, Child View? Views within a View? Pin
jkirkerx9-Nov-15 6:22
professionaljkirkerx9-Nov-15 6:22 
QuestionInterview Question Pin
zephaneas3-Nov-15 7:23
zephaneas3-Nov-15 7:23 
QuestionRe: Interview Question Pin
Richard MacCutchan3-Nov-15 21:57
mveRichard MacCutchan3-Nov-15 21:57 
AnswerRe: Interview Question Pin
Blikkies8-Nov-15 10:11
professionalBlikkies8-Nov-15 10:11 
GeneralRe: Interview Question Pin
Richard MacCutchan8-Nov-15 22:30
mveRichard MacCutchan8-Nov-15 22:30 
AnswerRe: Interview Question Pin
F-ES Sitecore9-Nov-15 5:05
professionalF-ES Sitecore9-Nov-15 5:05 
Questionhow to do a a parody album management ASP.NET application Pin
kushaochin2-Nov-15 21:30
kushaochin2-Nov-15 21:30 
AnswerRe: how to do a a parody album management ASP.NET application Pin
OriginalGriff2-Nov-15 21:32
mveOriginalGriff2-Nov-15 21:32 
GeneralRe: how to do a a parody album management ASP.NET application Pin
kushaochin2-Nov-15 21:43
kushaochin2-Nov-15 21:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.