I have a form with textbox. Besides this textbox i should have imagebutton / something which on clicking will open a popup window (lookup). This popup window will have UserId and Usernames (from db). So when the User selects one from this , the UserId should get selected in the textbox. How to do this? Please help. Can you please send me a sample of this type ..? Its very urgent.
Thanks lot..

i use the following code but its not working

to open popup

string servicename = ((Button)sender).Text.ToString();       
        string url = "Postcode.aspx?Websevice=" + servicename;
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(),"str", "<script language='javascript'>window.open('" + url + "','height=auto,width=1000,scrollbars=1,top=250,right=20');</script>", false);

this will fine open new user window

now i set selected variable of user list in parent page

string id = ViewState["Id"].ToString();
        string textid = "textbox5";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "str", "<script language='javascript'>window.opener.document.getElementById('" + textid + "').value ='" + id + "'; window.close();</script>", false);

here id is selected value and text id is parent page textbox id in which i want to pass value.

Recommended Answers

All 3 Replies

Use window.opener javascript method.

I already used it in my code see my code but i can't get value can u give me a working example. Thanks a lot for reply

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.