No you cannot write to the file in the client's machine. Its the security features. Any program executing in the browser executes within the browser sandbox and has access to limited features like printer, cookies etc.
But you cannot write to a file on user's machine. Somebody may use it to write a virus on user's machine. Its restricted.
Check this for a alternative solution..It writes the file as a "Response object" to the user's browser. The user has the choice whether to save it or not to his machine..
http://forums.asp.net/t/544299.aspx/1[
^]