Hi mluis,
Sorry for my previous answere was incorrect, but now I guess I fixed the problem,
you don't have to register the button with the script manager in the load event,
All I did is: set the updatemode to always not conditional
add a postback trigger to the update panel and set the controlid for the trigger to formview.id (the id of your formview)
<
Triggers>
<asp:PostBackTrigger ControlID="FormView1" />
</Triggers>
and it worked
Partial Class _Default Inherits System.Web.UI.Page Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
FormView1.PageIndex = (GridView1.PageIndex * GridView1.PageSize) + GridView1.SelectedIndex
End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim arquivo As FileUpload = FormView1.FindControl("FileUpload1") Dim AddressTextBox As TextBox = FormView1.FindControl("AddressTextBox")
Dim Image1 As Image = FormView1.FindControl("Image1")
If (arquivo.HasFile = True) Then arquivo.SaveAs(Server.MapPath("~\Images\" & arquivo.FileName)) AddressTextBox.Text = "~\Images\" & arquivo.FileName
Image1.ImageUrl = AddressTextBox.Text
Image1.Visible =
True
Else
Image1.Visible =
False
AddressTextBox.Text =
""
End If
End Sub
End Class