Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > General Discussions > Microsoft JScript runtime error: Could not complete the operation due to error c00ce514.

Not answered Microsoft JScript runtime error: Could not complete the operation due to error c00ce514.

Feed from this thread
  • M Kumar avatar

    Posted on Mar 21, 2012 (permalink)

    'I want do download the corresponding file when i click the grid Image button
    'Here i paste my code. it shows this bug(shows in attachment)


    Protected
    Sub ExplorerGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles VersionGrid.ItemCommand
            Dim objGridDataItem As GridDataItem = CType(e.Item, GridDataItem)
     
            Dim stringVersion As String
            stringVersion = objGridDataItem.Item("Version").Text
     
            Dim stringPath As String = Request.QueryString("filepath")
            Dim temppath As String = stringPath.Substring(0, stringPath.LastIndexOf("\"))
            Dim filename As String = stringPath.Substring(stringPath.LastIndexOf("\") + 1)
            filename = filename.Replace("'", "''")
            Dim sqlcon As New SqlConnection(ConfigurationManager.ConnectionStrings("MyConnection").ToString())
     
            Dim objSqlDASec As New SqlDataAdapter("select * from Sample where [DocumentName]= '" + filename + "'", sqlcon)
            objSqlDASec.SelectCommand.CommandTimeout = 1200
     
            Dim objDTSec As New DataSet
            objDTSec.Clear()
     
            objSqlDASec.Fill(objDTSec)
     
            Dim buffer As Byte()
     
            buffer = objDTSec.Tables(0).Rows(0)("Document")
     
            Try
     
                Dim req As New WebClient
                Dim response As HttpResponse
                response = HttpContext.Current.Response
                response.Clear()
                response.ClearContent()
                response.ClearHeaders()
                response.Buffer = True
                response.AddHeader("Content-Disposition", "attachment; filename=" + filename)
                response.ContentType = "application/octet-stream"
                response.BinaryWrite(buffer)
                response.Flush()
                response.End()
     
     
            Catch ex As Exception
     
            End Try
        End Sub
    Attached files

    Reply

  • Pavlina Pavlina admin's avatar

    Posted on Mar 26, 2012 (permalink)

    Hi,

    Please refer to the forum thread which elaborates on this matter and let me know if it helps to resolve the problem:
    http://www.telerik.com/community/forums/aspnet-ajax/grid/file-download-functionality.aspx

    All the best,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > General Discussions > Microsoft JScript runtime error: Could not complete the operation due to error c00ce514.