?
Solved

ASP.Net Question

Posted on 2003-03-27
5
Medium Priority
?
216 Views
Last Modified: 2010-04-06
hey,

im using an asp.net page which has a button tht opens a new browser window.what i wld like to know is tht is there any way wherein i can generate an onclick event of another button in the parent window when a button on the child window is clicked.
 i've tried using the javascript --- button.fireEvent("onclick") -- method..but this does not seem to work.

 This is the code i've used

----   ----------------------------
        Dim strnewscript As String
        strnewscript = "<script language=javascript>"
        strnewscript = strnewscript & "alert(""inside function"");"
        strjscript = strjscript & "window.opener." & HttpContext.Current.Request.QueryString("buttonname") & ".fireEvent(""onclick"")"
        strnewscript = strnewscript & "</script>"
        Literal3.Text = strnewscript

         '  (request.querystring("buttonname") contains "Form1.Button1")
---------------
 Please help me out

Thanks
0
Comment
Question by:sk1305
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Accepted Solution

by:
kenw23 earned 800 total points
ID: 8227560
One thing you could try is to create your own "__doPostBack" function and call it passing in the name of the button you wish to be the sender from the open window:

Page #1:
<script language=JavaScript>
function __doMyPostBack(eventTarget, eventArgument) {
    var theform = document.myForm;
    theform.__ECLEVENTTARGET.value = eventTarget;
    theform.__ECLEVENTARGUMENT.value = eventArgument;
    theform.submit();
}
</script>
<input type='hidden' name='__ECLEVENTTARGET' value='' />
<input type='hidden' name='__ECLEVENTARGUMENT' value='' />



Page #2:
<script language=JavaScript>
 opener.__doECLPostBack('myButton','save');
</script>
0
 

Expert Comment

by:kenw23
ID: 8227591
sorry, I meant on page #2:

Page #2:
<script language=JavaScript>
opener.__doMyPostBack('myButton','save');
</script>

0
 
LVL 5

Expert Comment

by:jef06
ID: 8238395
Dim script As String = "<script language=""JavaScript"">" & vbCrLf
script += "alert('"
script += Text + "'); " & vbCrLf & "</"
script += "script>"

You need to make the end of script tag like this it's a bug.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9115296
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
LVL 6

Expert Comment

by:Programming_Gal
ID: 9656081
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept kenw23's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Programming_Gal
EE Cleanup Volunteer
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question