3 Replies - 1807 Views - Last Post: 12 November 2013 - 04:00 AM Rate Topic: -----

#1 Thinus du Pisanie  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 107
  • Joined: 07-October 11

Asp.net javascript not compatible in all browsers.

Posted 08 November 2013 - 05:10 AM

Good day

I have a problem I have popup box that I call with java script in the popup there is grid view with values and I select a certain value that is written into the form. The problem is it only writes the value back if I use IE and not an any other browser. How do I make it compatible for all browsers?

Here is my code.

Javascript...

 <script language="javascript" type="text/javascript">
        function CloseFormOK(Prd) {
            window.returnValue = Prd;
            self.close();
        }
        function CloseFormCancel() {
            window.returnValue = false;
            self.close();
        }
        function clickButton(e, buttonid) {
            var evt = e ? e : window.event;
            var bt = document.getElementById(buttonid);
            if (bt) {
                if (evt.keyCode == 13) {
                    bt.click();
                    return false;
                }
            }
        }        
    </script>


Gridview...

    <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                        BorderColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px" DataKeyNames="EmailID" DataSourceID="SqlDataSource1"
                        Width="529px" CssClass="grd">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Button ID="cmdSel" runat="server" Text="Select" />
                                </ItemTemplate>
                                <ItemStyle Width="80px" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="Email_Message" HeaderText="Name" />
                             <asp:TemplateField HeaderText="IDCol" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblDat" runat="server" Text='<%# Eval("EmailID") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <RowStyle Font-Bold="False" Font-Italic="False" Font-Names="Arial" Font-Size="10pt" />
                        <EditRowStyle Font-Names="Arial" Font-Size="10pt" />
                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Names="Arial" Font-Size="10pt" 
                            Font-Underline="False" CssClass="grdhead" />
                        <AlternatingRowStyle CssClass="grdalt" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                        SelectCommand="SELECT * FROM lms_Email">
                    </asp:SqlDataSource>
                    <table>
                   
                    </table>
                </td>
            </tr>


Gridview Code......

 Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
        Dim strURL, DetID As String
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim cmdE As Button
            Dim cd As Label = CType(e.Row.FindControl("lblDat"), Label)
            DetID = cd.Text
            cmdE = TryCast(e.Row.FindControl("cmdSel"), Button)
            strURL = "javascript:CloseFormOK('" & DetID & "');"
            cmdE.OnClientClick = strURL
        End If
    End Sub


Any assistance would be great

Is This A Good Question/Topic? 0
  • +

Replies To: Asp.net javascript not compatible in all browsers.

#2 h4nnib4l  Icon User is offline

  • The Noid
  • member icon

Reputation: 1182
  • View blog
  • Posts: 1,677
  • Joined: 24-August 11

Re: Asp.net javascript not compatible in all browsers.

Posted 09 November 2013 - 05:06 PM

Where in that Javascript are you opening a pop-up with a GridView in it?
Was This Post Helpful? 0
  • +
  • -

#3 Thinus du Pisanie  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 107
  • Joined: 07-October 11

Re: Asp.net javascript not compatible in all browsers.

Posted 11 November 2013 - 12:01 AM

Sorry here it is:

  Private Sub Add_Button_Attrib()
        Dim ScriptOpenModalDialog As String = "javascript:OpenModalDialog('{0}','{1}','{2}','{3}');"
        Dim strURL As String

        SetFocus("txtEmail")

        strURL = pageUrlBase & "/Forms/Lookup/Lookup_Email.aspx"
        cmdFEmail.OnClientClick = String.Format(ScriptOpenModalDialog, strURL, cmdFEmail.ID, "600", hidden1.ClientID)

    End Sub

Was This Post Helpful? 0
  • +
  • -

#4 Thinus du Pisanie  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 107
  • Joined: 07-October 11

Re: Asp.net javascript not compatible in all browsers.

Posted 12 November 2013 - 04:00 AM

Good day

I seem to forget to told you that the pop up I am referring to is a asp.net form already created.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1