Markup page
<script runat="server">
Sub UpdateMessage(ByVal source As Object, ByVal e As SqlDataSourceStatusEventArgs)
If e.AffectedRows > 0 Then
' Perform any additional processing,
' such as setting a status label after the operation.
Page.Response.Redirect(Page.Request.Url.ToString(), True)
End If
End Sub 'UpdateMessage
</script>
<asp:SqlDataSource ID="ImgEditDS4" runat="server"
ConnectionString="< %$ ConnectionStrings:MyConnStr %>"
SelectCommand="SELECT [photo_id], [photo_1] WHERE ([photo_id] = @p_id)"
UpdateCommand="UPDATE [MyTable] SET [photo_1] = @photo_1 WHERE [photo_id] = @f_id"
OnUpdated="UpdateMessage" >
<SelectParameters>
<asp:QueryStringParameter Name="p_id" QueryStringField="aid" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="photo_1" Type="String" />
<asp:Parameter Name="p_id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>