ajax - Populate Textbox with Session Variable When Opening New Window -
i attempting populate textbox in new window session variable parent window using ajax call. when using fiddler, receive 200 message, however, when ran code, i'm getting 500 error.
i aware ajax call returning alert entire json result @ point because haven't gotten step pull session variable yet.
please offer additional solutions pull session variable parent window.
my js parent follows:
function openrelateditems(reportid) { window.open('../webuserprovider/reportlibraryview.aspx?r='+ reportid,'mywin','left=50,top=50,location=no,resizable=yes, status=yes, scrollbars=no, titlebar=no, channelmode=no, directories=no'); return false; }
my js window popup follows:
function callajaxmethod() { $.ajax({ type: "get", url: "reportlibraryview.aspx/getsetsessionvalue", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (response) { alert(response.d); } }); } $(function () { var value = callajaxmethod(); var b; });
my codebehind ajax call follows:
[system.web.services.webmethod (enablesession = true)] public static string getsetsessionvalue() { return httpcontext.current.session["appealno"].tostring(); }
Comments
Post a Comment