Ashok

Ashok

  • NA
  • 507
  • 76.5k

Unable to get property 'textbox1' of undefined or null refer

Mar 28 2016 8:53 AM
Hello i am trying to transfer data from webform1 to webform2 how to acheive this using javascript and whn i tried i am getting this error ex:"0x800a138f - JavaScript runtime error: Unable to get property 'textbox1' of undefined or null reference"
following is the code which is under button click event.Thanks
ex:
---
string strtxtid=datagrid.items[0].cells[1].text.trim();
string strtxtname=datagrid.items[0].cells[2].text.trim();
string strSubject=datagrid.items[0].cells[3].text.trim();
strScript += "<script language=javascript>";
strScript += "window.open.Webform1.textbox1.value='" + strtxtid + "';";
strScript += "window.open.Webform1.textbox2.value='" + strtxtname + "';";
strScript += "window.open.Webform1.textbox3.value='" + strSubject + "';";
strScript += "window.open.__doPostBack('textbox4','');";
strScript += "window.close();";
strScript += "</script>";
Response.Write(strScript);

Answers (2)