I try onClick Event and call Gridweb1.LoadPostData() but Excel data not update


#1

on your code

I got Error because no attribute onmousedown.

I try onClick Event and call Gridweb1.LoadPostData() but Excel data not update. let see my code below




Private Sub ButtonExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonExport.Click


Gridweb1.LoadPostData()

Gridweb1.WebWorksheets.SaveDataToExcelFile(TempFilePath, originalFilePath)

' Sents the file to browser.
Response.ContentType = "application/vnd.ms-excel"

'Adds header.
Response.AddHeader("content-disposition", "attachment; filename=" & TempFileName)

' Writes file content to the response stream.
Response.WriteFile(TempFilePath)

' OK.
Response.End()

End Sub


#2

Hi,

These code run ok in my VS.net 2002. Please try again. If it still doesn't work, try this:

In Page_Load event handler, add this line:

[VB]

Button1.Attributes("onmousedown") = "GridWeb1.updateData();"

[C#]

Button1.Attributes["onmousedown"] = "GridWeb1.updateData()";