473,563 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

script code not working while passing value from popup to opener page

1 New Member
I want to display fields(row) selected from grid in popup window to textboxes in Opener window.

I have written code as follows :

Main Opener window

Expand|Select|Wrap|Line Numbers
  1.  protected void Button1_Click(object sender, EventArgs e)
  2.         {
  3.  
  4.             Response.Write("<script>popUp=window.open('SearchUser.aspx?master=NONSAP_ApplMaster&PAGETYPE=textbox&emp_id=" +  txtEmpID.ClientID + "&emp_name=" + txtEmpName.Text.Trim() + "&postBack=false','popupuser','width=165,width=600,height=400,left=250,top=150,scrollbars=yes');</script>"); 
  5.  
  6.         }
  7.  
popup window:


Expand|Select|Wrap|Line Numbers
  1. protected void grdUserList_RowDeleting(object sender, GridViewDeleteEventArgs e)
  2.         {
  3.             string s1 = "";
  4.             string s2 = "";
  5.             s1 = "<script>window.opener.document.getElementById('" + txtEmpID + "').value='" + grdUserList.Rows[e.RowIndex].Cells[1].Text + "';</script>";
  6.          + grdUserList.Rows[e.RowIndex].Cells[2].Text;
  7.             s2 = "<script>window.opener.document.getElementById('" + txtEmpName + "').value='"  + grdUserList.Rows[e.RowIndex].Cells[2].Text + "';window.close();</script>";
  8.                       // Response.Write("<script>alert('HiddenField !')</script>");
  9.             Page.RegisterStartupScript("ClientScript", s1);
  10.             Page.RegisterStartupScript("ClientScript", s2);
  11.         }
  12.  
plz help me out i hve spent one day to solve this but still it is not working.
Nov 10 '08 #1
1 1425
acoder
16,027 Recognized Expert Moderator MVP
Rather than posting the server-side code, post the generated client-side JavaScript and HTML code.
Nov 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4334
by: Raju V.K | last post by:
can I use javascript and PHP in the following manner to create a pop-up window: <--- in <head> </head> <script language=javascript> function popup(folder1, file1) { window1=open("solution.php?folder=folder1&file=file1"); }
11
2814
by: Wentink | last post by:
Does anybody have a simple script that let's me popup a picture from a thumbnail? The ones i found are all very very complicated and messy in the source... Thanks, Tintin
1
2626
by: Martin John Brindle | last post by:
Is it possible to return a value from a popup window? I really need something that can do this and the behaviour of the createpopup method is perfect except i can't work out how to return a value. As an aside, I can't use other url's, which means it all needs to be contained within the one file, but that's something I can solve later! ...
4
10483
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a description and a class_id (stored in the value attribute of each option). The user will then select a class from the drop-down list. What I want...
4
1912
by: louise raisbeck | last post by:
I have this scenario (simplified) function addnewdata () { check for partial match already in db for information entered by user if (partialmatch succeeds) { open new window aspx page (using javascript) with a datagrid of these partial match records (by doing a sqlcommand using some query string values taken from opener data entered) ***...
1
2213
by: billy | last post by:
Ok, here's the situation... I have a user control that contains two textboxes (one for a from date/time and one for a to date/time) and two image buttons. The user control itself is supposed to be used on a number of different ASPX pages (that's why I made it a ASCX). When clicking the image button, I run simple JavaScript to open another...
2
2324
by: sangram | last post by:
i need a javascript for popup window and how to pass value to that new window from old window .
0
7579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7877
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7943
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6238
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5479
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3631
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2077
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
912
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.