Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

How to Update an Item from REPEATER CONTROL in Asp.Net web forms

webforms asp.net repeater

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1 Amonijack


    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 89 posts

Posted 06 November 2014 - 04:30 PM

I have button on a Item named UPDATE. This button opens a dialog where user should change name, description ... etc.


But i cant use ID from a curently-editing item. The ID losts when dialog opens up.



 help ?




#2 BlackRabbit


    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 06 November 2014 - 06:05 PM

We'll need to see the code to help.

Still, if before opening the dialog you have the ID, and then you don't, what you should do is to pass the ID as a parameter to the dialog.

#3 Amonijack


    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 89 posts

Posted 07 November 2014 - 03:12 PM

This is my script :


       $(document).ready(function () {
           $("#Update").click(function () {




and button where script should fire

                            <asp:Button ID="Update" runat="server" Text="Update" CssClass="btn-default"/>

this is the code id = update

      <div class="modal fade" id="update" role="dialog">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="form-horizontal">
                            <div class="modal-header">
                                <h4 class="dark-text">Update</h4>

                        <div class="modal-body">
                            <div class="form-group">

                                <br />
                                <br />
                                <label for="image-info" class="col-lg-3 control-label">Image Name</label>
                                <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                                <br />
                                <label for="image-info" class="col-lg-3 control-label">Description</label>
                                <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                                <br />

                        <div class="modal-footer">
                            <asp:Button ID="Button3" runat="server" CssClass="btn btn-success" Text="Button" OnClick="SaveImage" />
                            <asp:Button ID="Button6" runat="server" Text="Close" />

The Update button is part of the ITEM, and ITEM is a part of Repeater Control.


I have two problems.

First is : script not fires up and second i cant finally make an update.


Help ?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download