• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

ASP.Net Question

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
sk1305
Asked:
sk1305
1 Solution
 
kenw23Commented:
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
 
kenw23Commented:
sorry, I meant on page #2:

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

0
 
jef06Commented:
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
 
COBOLdinosaurCommented:
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
 
Programming_GalCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now