I am working on a web application where I have a master aspx page that contains a button. Upon clicking this button, I am calling an ascx web user control. Within this ascx control, I am using JavaScript to post data back to the same ascx page. While I know that it is possible to post data in an ascx page, I am struggling with how to achieve it.
xhr.open('POST', '../test.ascx?Id=' + <%=Id%>, true); //Id is the property in ascx page
xhr.setRequestHeader('FILENAME', file.name);
xhr.send(file);
Additionally, during OnInit...
if (!string.IsNullOrEmpty(Request.Headers["FileName"]))
{
string Name = Request.Headers["FileName"].ToString();
Stream Stream1 = Request.InputStream;
Add(Name, Stream1, Id);
}