i wanted to pass value from javascript to my aspx page, both are in same page.. the code is
javascript code
var OpenPopup = function () {
alert("value");
var value = window.showModalDialog("PopUp.aspx", 'popup', "dialogHeight:15; dialogWidth:20; center:yes;toolbar: false;status: 0;scroll:0;unadorned:0;help:no");
alert(value);
alert(document.getElementById('hdnField').value = value);
alert(value);
}
alert(value);
document.getElementById('hdnField').value = value;
clientside code for hiddenfield:
<asp:HiddenField ID="hdnField" runat="server" />
serverside code:
protected void Button1_Click(object sender, EventArgs e)
{
string name = Request.Form["hdnField"];
string aa = hdnField.Value.ToString();
}
after the javascript is executed, i clicked on a button to check value stored in hdnfield bt it returns null value... also. in javascript alert shows output till 2nd alert.. as alert goes into 3rd alert it stops showing 3rd and 4th alert.. is there anything i am missing???