Within my ASP.NET Webform, I have a server-side Button with an Onclick event registered on it.
<asp:Button ID="UploadButton" CssClass="btn add btn-primary" runat="server" Text="Upload File" OnClick="UploadButton_Click" />
My goal is to, after processing on the Server Side, return a response object to the client side (such as assigning it to a JavaScript variable).
How can I retrieve the object returned from the button click event on the client side?
protected ResponseModel UploadButton_Click(object sender, EventArgs e)
{
ResponseModel responseModel = new ResponseModel();
//Process file
//Fill response object
return responseModel
}
The UploadButton_Click()
method originally had a void return type.