locked
Add Record RRS feed

  • Question

  • User1979860870 posted

    Hi

       I have below aspx page .  Kindly guide what should be done to Add Record 

    <button type="button" class="btn btn-primary" id="btnAdd" onclick="return Add();">Add</button>

    <asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" onclick="clearTextBox();">Add New Location</button><br /><br />
                <div class="row">  
                    <div class="col-lg-12 "> 
                        <div class="table-responsive">
                            <asp:GridView ID="gvwLocation" OnPreRender="gvwLocation_PreRender" runat="server" 
                            CssClass="table table-bordered table-striped" AutoGenerateColumns="false" OnRowCommand="gvwLocation_RowCommand" OnRowCreated="gvwLocation_OnRowCreated" 
                            BorderWidth="1px"  BorderStyle="None" BorderColor="#DEBA84" HeaderStyle-CssClass="GridHeader" ClientIDMode="Static"
                            EmptyDataText="No Records Found!" EmptyDataRowStyle-ForeColor="Red" EmptyDataRowStyle-CssClass ="gvEmpty" >
                            <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#428bca"></HeaderStyle>
                            <Columns>
                                <asp:TemplateField HeaderText="Action">
                                    <ItemTemplate>
                                        <asp:linkbutton id="btnEdit"  ToolTip="Update Record" CommandName="EditRow" CausesValidation="False" runat="server" CssClass="clslnkbutton"/> 
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Id">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblId" Text='<%#Eval("Id") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Description">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblDescription" Text='<%#Eval("Description") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            </asp:GridView>
                        </div>
                    </div>
                </div>
    
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        @*<button type="button" class="close" data-dissmiss="modal"><span aria-hidden="true">&times;</span></button>*@
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label for="Name">Id</label>
                            <input type="text" class="form-control" id="Id" placeholder="Location Id" />
                        </div>
                        <div class="form-group">
                            <label for="Name">Description</label>
                            <input type="text" class="form-control" id="Description" placeholder="Location Description" />
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary" id="btnAdd" onclick="return Add();">Add</button>
                        <button type="button" class="btn btn-primary" id="btnUpdate" style="display:none;" onclick="Update();">Update</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
        </div>
    
    </asp:Content>

    Thanks

    Sunday, May 23, 2021 12:29 PM

All replies