I know that in the Windows Forms desktop application, you can:
String name, preferred color, hair style; Name = "Jason"; Favorite color = "Dependent on the current mood."; Hair style = "spikey"; But what could be the use of C # with ASP.NET websites?
You can:
var name = "jason"; Var favorite color = "dependent on current mood."; Var Hair Style = "Spikey"; But is it too correct for doing this?: var name, favorite color, hair style; Name = "Jason"; Favorite color = "Dependent on the current mood."; Hair style = "spikey"; The reason I am asking is because I am not getting anywhere in the docs, where it says that you should or should not do it. And I really dislike doing this way:
var fname = ""; Var lname = ""; @ {Fname = row.FirstName; Lname = row.LastName; } I will do a lot like this:
var fname, lname; @ {Fname = row.FirstName; Lname = row.LastName; } Any help is appreciated.
Thanks
Given that it is asp.net, you actually Var can be declared as a type, and both implementations (this is C # after all, no matter how you paint it, try it and compile it), so both are correct talk. And no, it does not matter how you write it to it as long as it is well-documented and sticks in the code style you are using.
But do not try to overuse it, it is much better if you remember
in the web, things work a bit, using a strong type of yourself To, every time, the string (no cap, no subtle difference) is different. If you are assigning it before the reaction, then it should be fine, if it is an Ajax response, do not forget to repeat the thing that you want to change.
Comments
Post a Comment