0

is this code is write or wrong?

imgbtnProdSearch.Attributes.Add("onclick", "window.open('popUp.aspx?name=" +txtSelectProdName.ClientID+"','_new','width=1000px,height=1000px');return false");
hackp0int
  • 4,052
  • 8
  • 59
  • 95
Devendra526
  • 7
  • 1
  • 1
  • 3
  • Could you elaborate a bit further? Do you want to pass values from the pop up window to the parent or the other way around? Also post some more of your code if you have any. – Niklas Mar 29 '12 at 06:07
  • protected void imgbtnProdSearch_Click(object sender, ImageClickEventArgs e) { imgbtnProdSearch.Attributes.Add("onclick", "window.open('popUp.aspx','_new','width=1000px,height=1000px');return false"); if (Session["ProdName"] != null) { txtSelectProdName.Text = Session["ProdName"].ToString(); } } – Devendra526 Mar 29 '12 at 06:12
  • in this code the first line opens a popup window. after taking a value from popup window it should have to go to next step. but problem is that it is showing popup window after second step. that is why i m not getting value. please help me out with this – Devendra526 Mar 29 '12 at 06:16

1 Answers1

0

have u tried adding the code in Page Load as follows.

 protected void Page_Load(object sender, EventArgs e)
        {
            imgbtnProdSearch.Attributes.Add("onclick", "window.open('popUp.aspx','_new','width=1000px,height=1000px');return false");
        }

EDIT...

protected void Page_Load(object sender, EventArgs e)
        {
            imgbtnProdSearch.Attributes.Add("onclick", "window.open('popUp.aspx','_new','width=1000px,height=1000px');return true");
        }
chamara
  • 12,649
  • 32
  • 134
  • 210