I have an iframe in asp.net, using c# . When the iframe with a story ends, I want to fire a button in parrent window via java script.
The iframe window has its own html file and js file. when the iframe come to an end of story in the js file run
case "ClosePlayer":
trig();
break;
then I call another js file with a simple function
function trig()
{
//$('#<%= SubmitButton.ClientID %>').click();
//document.getElementById('<%= SubmitButton.ClientID %>').click();
document.getElementById("SubmitButton").click();
// alert("javascript here");
}
in the main window in asp.net I have this button
<asp:Button ID="btnProceedToNextTab" runat="server" Text="Proceed" OnClick="btnProceedToNextTab_Click" />
and I want to trigger this with another button via javascript, so the code behind of the function btnProceedToNextTab_Click();
run
<asp:Button ID="SubmitButton" runat="server" Text="Button" OnClientClick="trig();" />
Can anyone help me? I tried to use jquery, but nothing fires the button. The alert messages show ok, but the button is never clicked.