strongly-typed

Strongly typed controller name in asp.net mvc 2

Hello, Is it possible to use strongly typed controller name and action name in asp.net mvc? for example instead of ActionLink("ActionName", "ControllerName"); somthing like this ActionLink(ControllerName(x=>x.ActionName()), ControllerName) Thanks, Alexander. ...

linq groupby in strongly typed MVC View

How do i get an IGrouping result to map to the view? I have this query: var groupedManuals = manuals.GroupBy(c => c.Series); return View(groupedManuals); What is the proper mapping for the ViewPage declaration? Inherits="System.Web.Mvc.ViewPage<IEnumerable<ProductManual>>" ...

Strongly typed API for ASP.NET MVC 2 async actions

Hi guys, Have anybody tried to create strongly typed API for ASP.NET MVC 2 async actions? Best regards, Alexey Zakharov ...

How to create a complete generic TreeView like data structure

I want to create a completely generic treeview like structure. some thing like this: public class TreeView<T, K, L> { public T source; public K parent; public List<L> children; } as you can see in this class source, parent and also the children, all have a different generic data type. also i want my tree view to have unlim...

How to check if a variable is defined in a Master file in ASP.NET MVC

I've got a Site.Master file I've created to be my template for the majority of the site, with a navigation. This navigation is dynamically created, based on a recursive Entity (called Page) - Pages with a parentID of 0 are top level, and naturally each child carries it's parent's Id in that field. I've created a quick little HTML Helpe...

PHP 'instanceof' failing with class constant

I'm working on a framework that I'm trying to type as strongly as I possibly can. (I'm working within PHP and taking some of the ideas that I like from C# and trying to utilize them within this framework.) I'm creating a Collection class that is a collection of domain entities/objects. It's kinda modeled after the List<T> object in .N...

What strongly typed languages should I consider for my next development language?

I'm currently assessing which strongly-typed server-side languages I could choose to learn next. I'm coming from a background of mainly php development (oop). I'm looking at strongly-typed languages as I consider this a major downside to php (and sometimes an upside). I know both C# and Java (JSP/Servlets) are an option, however I wante...

How far to go with a strongly typed language?

Let's say I am writing an API, and one of my functions take a parameter that represents a channel, and will only ever be between the values 0 and 15. I could write it like this: void Func(unsigned char channel) { if(channel < 0 || channel > 15) { // throw some exception } // do something } Or do I take advantage of C++ be...

Help with creating strongly typed html helper extension in Asp.net MVC 2

Hey I'm trying to create a strongly type html helper extension for a date picker using jquery ui datepicker. I have created an extension that isn't strongly typed, which works but now I'm trying to create it strongly typed. Here is what I have: public static MvcHtmlString DatePicker(this HtmlHelper html, string name, object date) ...

How do you work with a variable that can be of multiple types?

I frequently link objects to their parents using: Video parent; Sometimes I have objects that can be children of different object types, so do I: int parentType; Video parentVideo; // if parent == VIDEO then this will be used Audio parentAudio; // if parent == AUDIO then this will be used Is there a better way? How do I work wi...

Storing ASP.NET MVC 2 session data on login

I've got an implementation similar to this: http://stackoverflow.com/questions/1710875/better-way-of-doing-strongly-typed-asp-net-mvc-sessions for quick access to frequently-needed user data... but i have two questions: 1) will there ever be a time when a user is logged in, but the session would be invalid or reset? I always thought th...

Is weak typing not necessary anymore?

I come from a statically/strongly typed language background (java), and I recently started to learn python and I think I see the value of dynamic/strongly typed language. Now I'm wondering whether weak typing can be ever desirable. Going through stackoverflow, I only found explanations that say it has performance benefits. Since th...

What are the alternatives to subtype polymorphism in scala?

I'm interested to know the complete set of alternatives to subtype polymorphism in scala. ...

mvc.net how to use strongly typed helpers while iterating through list

I have a partial view that renders a list of objects into a table format and allows editing of the values... <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IList<whoozit.Models.PictureModel>>" %> <% foreach (whoozit.Models.PictureModel p in Model) { %> <td> <%: Html.TextBox("name",p.name) %> <%: Ht...

How much time to compile a view in ASP.NET?

How much time is spent compiling a view in ASP.NET? Of course I don't expect anyone to give me a number, but I think it's interesting to have an idea of how much time this takes because it could influence the way we implement things. For example, if the time is significant , then I might try to put every result that I need to display i...

Is this possible using generics? c#

I know I can solve the following problem just by creating a custom class, but can the following be strongly typed as a List(or any other type)? var x = new object[] { new object[] { new Image(), new TextBox(), new FileUpload() }, new object[] { new Image(), new TextBox() , new FileUpload()} ...

SGEN error "Strong name validation failed."

Hi, I've been trying to use sgen.exe to genererate serialization assembly for my strong name signed assembly. I tried various set of parameters for sgen, but all my attempts ended with this error: SGEN: error SGEN1: Could not load file or assembly MyLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of i...

Strongly-typed generic method invokes its argument's base class method, instead of a shadowed method in T?

Consider a MyForm class that contains a shadowed implementation of Show(), and a CreateForm() method that accepts an instance of the form and calls the shadowed sub: Public Class MyForm Inherits Form Public Shadows Sub Show() MessageBox.Show("Shadowed implementation called!") End Sub End Class ... Public Sub Creat...

Why is tightly coupled bad but strongly typed good?

I am struggling to see the real-world benefits of loosely coupled code. Why spend so much effort making something flexible to work with a variety of other objects? If you know what you need to achieve, why not code specifically for that purpose? To me, this is similar to creating untyped variables: it makes it very flexible, but opens ...