Click here to Skip to main content
15,884,976 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
how i can accessing to nested elements in a asp or html code for use in a script.
such as in this code i want access to values this element and use it in the a script :
"<asp:Button ID="Add" runat="server" Text="Add" Width="37px" />"

<head  runat="server">
    <title></title>

  <style type="text/css">
    .TemplateStyle{padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;margin: auto;}
    </style>

</head>
<body>
<script type="text/javascript">
document.getElementById('GridView1').

</script>
    <form id="form1"  runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1"  runat="server">
    
    <telerik:RadScriptManager ID="ScriptManager1"  runat="server" 
        EnableTheming="True">
    
    <div>
   
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
            DeleteMethod="Delete" InsertMethod="Insert" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
            TypeName="DataSet1TableAdapters.CountryTableAdapter" UpdateMethod="Update">
            <deleteparameters>
                <asp:Parameter Name="Original_ID" Type="Int64" />
            </deleteparameters>
            <insertparameters>
                <asp:Parameter Name="Name" Type="String" />
            </insertparameters>
            <updateparameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Original_ID" Type="Int64" />
            </updateparameters>
        
   
    </div>
        <div>
         <asp:GridView 
                ID="GridView1" runat="server" EnableModelValidation="True" 
                AutoGenerateEditButton="True" onrowediting="GridView1_RowEditing" 
                onrowupdated="GridView1_RowUpdated" onrowupdating="GridView1_RowUpdating" 
                style="margin-right: 0px" Width="207px" AutoGenerateColumns="False" 
                BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" 
                CellPadding="3" GridLines="Horizontal" ShowFooter="True">
                <alternatingrowstyle backcolor="#F7F7F7" />
                <columns>
                    <asp:TemplateField HeaderText="ID">
                        <footertemplate>
                            <asp:Button ID="Add" runat="server" Text="Add" Width="37px" />
                        </footertemplate>
                        <itemtemplate>
                            <asp:TextBox ID="ID" runat="server" ReadOnly="false" Text='<%# Bind("ID") %>' Width="40px" 
                                CssClass="TemplateStyle">
                        </itemtemplate>
                    
                    <asp:TemplateField HeaderText="Name">
                        <footertemplate>
                            <asp:TextBox ID="CountryFooter" runat="server" Width="108px">
                        </footertemplate>
                        <itemtemplate>
                            <asp:TextBox  ReadOnly="false" ID="Country" runat="server" Text='<%#Bind("Name") %>' 
                                CssClass="TemplateStyle">
                        </itemtemplate>
                    
                </columns>
                <footerstyle backcolor="#B5C7DE" forecolor="#4A3C8C" />
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                <pagerstyle backcolor="#E7E7FF" forecolor="#4A3C8C" horizontalalign="Right" />
                <rowstyle backcolor="#E7E7FF" forecolor="#4A3C8C" />
                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
            
        </div>

        <div>
           
           <script type="text/javascript">
               function myfunction() {
                            
               }
           </script>
 

    </div>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        DeleteMethod="Delete" InsertMethod="Insert" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
        TypeName="DataSet1TableAdapters.CustomerTableAdapter" UpdateMethod="Update">
        <deleteparameters>
            <asp:Parameter Name="Original_ID" Type="Int64" />
        </deleteparameters>
        <insertparameters>
            <asp:Parameter Name="Code" Type="String" />
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="Gender" Type="Boolean" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="BirthDate" Type="DateTime" />
            <asp:Parameter Name="Country_ID" Type="Int64" />
            <asp:Parameter Name="Telephone" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="SerialNumber" Type="Decimal" />
        </insertparameters>
        <updateparameters>
            <asp:Parameter Name="Code" Type="String" />
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="Gender" Type="Boolean" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="BirthDate" Type="DateTime" />
            <asp:Parameter Name="Country_ID" Type="Int64" />
            <asp:Parameter Name="Telephone" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="SerialNumber" Type="Decimal" />
            <asp:Parameter Name="Original_ID" Type="Int64" />
        </updateparameters>
    
    <div>
    </div>
    </form>
</body>
</html>
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900