In the calling page:
myiframe.Attributes["src"] = ResolveUrl("~/FileCS.ashx?documentid=" + HttpUtility.UrlEncode(id) + "&username=" + HttpUtility.UrlEncode(username));
In the handler:
string id = context.Request.QueryString["documentid"];
string username = context.Request.QueryString["username"];
Although, since the username comes from the session, you could just as easily access the session from the handler; you'd just need to implement
the IReadOnlySessionState interface[
^]:
public class LoadPdfFileHandler : IHttpHandler, IReadOnlySessionState
{
public bool IsResuable => false;
public void ProcessRequest(HttpContext context)
{
string id = context.Request.QueryString["id"];
string username = Convert.ToString(context.Session["username"]);