Question: I have a MVC3 application with ASPX view engine. My page is having a dropdownlist created by 

```
Html.DropdownListFor(m=>m.EmpId,(selectlist)Model.EmpDetails).

```

I update this dropdown on a situation where it would have only one item and make that disabled, by Jquery. Now when I go to form post, my model's `'EmpId'` property is not updated with the corresponding value of its selected item in dropdown list. I suspect, since the dropdownlist is not manually selected (updated by Jquery), I'm not getting `'EmpId'` in my model. Is there a way to overcome this issue?

With regards,
Saravanan

Answer: 
You can look at the `Content-Type` HTTP header to figure out what *type* of file you are getting — but you can't find out what the filename used on the server is (or even if there is a filename), and (in most cases) both index.html and default.asp will return an HTML document.
Two points here:

* Firstly, no it is not possible to work out the name of the file that was served if you just requested the root of a directory. This is handled internally by the web server, and it doesn't tell the client how it was handled. Sorry.
* Secondly - surely you can just give all the files a `.html` extension if no file name was specified? In 99% of cases the default file that is served is HTML, even if it is a `.asp` or `.php` extension, all that it spits out is dynamically generated HTML. You don't get the source code, only the result.

**EDIT**

This is the best solution I can come up with for determining a sensible file extension based purely on the URL:

```
$urlParts = parse_url($url);
if (!isset($urlParts['path'])) $ext = 'html'; else {
  $pathParts = explode('/',$urlParts['path']);
  $ext = (count($fileParts = explode('.',array_pop($pathParts))) > 1) ? array_pop($fileParts) : 'html';
}

```