I have the following function:
public ActionResult Index(string caller_id, int? id)
{
Now I am using the following code to set a value:
var _id = id.HasValue ? (int) id : 0;
Is it possible for me to make the value of id default to something when the function is called without id being set?
Thanks,
Alison
Yes, you can do that but only if you use .net 4.0+
Named and Optional Arguments (@msdn)