because in the context of a 'new { ... }' expression the 's' does not correspond to a variable as it may first appear - it defines the name of a member of an anonymous class that is created.
when you say :
new { S = 123 }
you are actually generating a class, which is anonymous (you never get to see the name of the class). The type of each member of the class is implicitly determined by whatever you're assigning to it. In the above example a class something like this is generated
class AnonymousClass_S483Ks4 {
public int S {get;set;}
}
There are two ways you can do what you want:
1) you would have to say :
new { cool = 123 }
2)
Now I assume though that you want the name to be dynamic so you need to use RouteValueDictionary which allows you to put key value pairs in.
// RouteValueDictionary is IDictionary<string, object>
var dictionary = new RouteValueDictionary();
string s = "cool";
dictionary.Add(s, 123);
htmlHelper.ActionLink("Home", "Index", dictionary);
As you can see, here you can use a variable 's' to represent whatever you want. This should give you the URL you need.