I know I'm asking 2 questions but I'm really stuck. I have a form for adding and updating records and when I click the Update button(my Add works fine with the pop-up), I want a pop-up to appear with the properties of the record I get from my script(i.e. every texbox/dropdownlist filled with the correct values).
This is my script:
function btnEditEP_Click() {
var recID = document.getElementById('<%=tboxEdit.ClientID%>').textContent;
//if (recID !=null) {
// alert("ok what now?");
//}
window.open("editPopupEP.aspx?Txt=" + recID, "_blank", "toolbar=yes", "resizable=yes", "scrollbars=yes");
}
And this is my PageLoad in editPopupEp.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
int recID = Convert.ToInt32(Request.QueryString["Txt="]);
...
..
.
If I can get the record ID, populating the input fields is easy but I need/want to get the Text of the Textbox and receive it from codebehind with QueryString.
The pop-up window works and there are no errors but the recID has 0 in it and there is no such record.