ASP.NET Setting DetailsView BoundField value from javascript

I would like to know if it is possible to set the DetailsView's BoundField (in edit mode) from javascript? I can't set the id for the associated field, so obviously I can't use document.getElementById () to get to it, but I was wondering if there is another way to do this?

0


a source to share


1 answer


You can try to create an EditItemTemplate, put the TextBox inside and provide it with an id of your choice.

Like this:

<Fields>
        <asp:TemplateField HeaderText="Column1">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            </EditItemTemplate>
        </asp:TemplateField>
    </Fields>

      



If the TextBox Text property has stuff to bind, you can use the Bind () method.

Good luck.

+1


a source







All Articles