gromul
asked on
5000 Points
I offer 5000 points for anyone who helps me solve the problem mentioned in this post:
https://www.experts-exchange.com/questions/20938180/'contentWindow-document-is-null'-error.html
I'll create 8 more questions of 500 points worth.
Thanks
https://www.experts-exchange.com/questions/20938180/'contentWindow-document-is-null'-error.html
I'll create 8 more questions of 500 points worth.
Thanks
What do you think!?? All experts need point?? I don't think so.
Gromul,
This is actually against EE policy (awarding 5,000 points). I'm sure the moderators will keep the point system in check.
Just an FYI
I will accept 500 points and you do what you want as far as bonus points :)....
The following works for me and I would recommend you start with something very simple like this and then build/modify until it breaks... Also PLS remember that JavaScript IS case sensitive... function Dog is not the same as function DOG....
Stick with me and we will make this work!!!
Have Fun,
Dante
codebehind ---->> Please notice I put withing PostBack code to prevent from asking over & over...
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim sString As System.Text.StringBuilder
sString = New System.Text.StringBuilder
sString.Append("<script language='Javascript'>")
sString.Append("var res= confirm('Are you sure you want to update this article?');")
sString.Append("if (res == 1) {" & vbCrLf)
sString.Append(" OurForm.txtValidateUpdate. value = 1;" & vbCrLf)
sString.Append(" OurForm.btnValidateUpdate. click();" & vbCrLf)
sString.Append("}" & vbCrLf)
sString.Append("</")
sString.Append("script>")
Page.RegisterStartupScript ("Validate UpdateScri pt", sString.ToString())
End If
End Sub
Private Sub btnValidateUpdate_Click(By Val sender As Object, ByVal e As System.EventArgs) Handles btnValidateUpdate.Click
If txtValidateUpdate.Value = 1 Then
'ExecUpdate()
End If
End Sub
.aspx----->
<body MS_POSITIONING="GridLayout ">
<form id="OurForm" method="post" runat="server">
<input type="hidden" id="txtValidateUpdate" value="0" runat="server" NAME="txtValidateUpdate">
<asp:Button ID="btnValidateUpdate" Text="_" height="1" width="1" runat="server" />
</form>
</body>
The following works for me and I would recommend you start with something very simple like this and then build/modify until it breaks... Also PLS remember that JavaScript IS case sensitive... function Dog is not the same as function DOG....
Stick with me and we will make this work!!!
Have Fun,
Dante
codebehind ---->> Please notice I put withing PostBack code to prevent from asking over & over...
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim sString As System.Text.StringBuilder
sString = New System.Text.StringBuilder
sString.Append("<script language='Javascript'>")
sString.Append("var res= confirm('Are you sure you want to update this article?');")
sString.Append("if (res == 1) {" & vbCrLf)
sString.Append(" OurForm.txtValidateUpdate.
sString.Append(" OurForm.btnValidateUpdate.
sString.Append("}" & vbCrLf)
sString.Append("</")
sString.Append("script>")
Page.RegisterStartupScript
End If
End Sub
Private Sub btnValidateUpdate_Click(By
If txtValidateUpdate.Value = 1 Then
'ExecUpdate()
End If
End Sub
.aspx----->
<body MS_POSITIONING="GridLayout
<form id="OurForm" method="post" runat="server">
<input type="hidden" id="txtValidateUpdate" value="0" runat="server" NAME="txtValidateUpdate">
<asp:Button ID="btnValidateUpdate" Text="_" height="1" width="1" runat="server" />
</form>
</body>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks James.
Has anyone found an answer to the contentWindow.document I am trying to click a Server side button from the javascript like this.
form1.mybutton.click()
form1.mybutton.click()