Monday, September 15, 2008

Response.End and download file problem using asp.net code inside sharepoint

Issue:

To download file from Sharepoint doesn’t work but works fine in plain asp.net environment.

Solution:

Solution is very simple, Add the following code for the button or link which initiates the download:

MyButton.OnClientClick = "document.getElementById(""" & Me.Page.Form.ClientID & """).onsubmit = function() {return true;}"

Link: http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/107b2c17-07fe-4a15-ad81-dcb31e1e9c84

No comments: