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.

Is it considered accepted using var's as "shortcuts" in c#? -


one use var type in c# seems shortcuts/simplifying/save unnecessary typing. 1 thing i've considered this:

myapp.properties.settings.default.value=1;

that's ton of unnecessary code. alternative declaring:

using myapp.properties; 

-- or --

using appsettings = myappp.properties.settings; 

leading to: appsettings.default.value=1 or settings.default.value=1

abit better, i'd shorter still:

var appsettings = myfirstcsharpapp.properties.settings.default; appsettings.value=1; 

finally, it's short enough, , used other annoyingly long calls accepted way of doing it? i'm considering whether "shortcut var" pointing existing instance of whatever i'm making shortcut too? (obviously not settings in example)

it's acceptable code in compiler take , know it. it's acceptable code logically in shortens code later. it's not different defining variable type (int/bool/whatever) rather saying var. when you're in studio, putting mouse of variable gives compiled type, there shouldn't real issue it. might call lazy, laziness mother of invention. long code doesn't become unreadable, can't see how of problem.


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 -