Saturday, November 3, 2018

how to auto refresh asp.net Grid view |Sradha Webcreations

auto update e-commerce website customer  order in admin panel | Auto refresh asp.net Grid view ,  Auto Refresh Asp.net repeater control, Datalist Control

  Default.aspx page 

  • add script manager 
  • add update panel 
  • set timer control also set Interval="1000" 

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
               
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                          <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="1000"></asp:Timer>
  <asp:Repeater ID="Repeater1" runat="server">
              <HeaderTemplate>  
                  
                                <table style=" width:100%;  line-height:30px" >  
                            <tr style="background-color:#990000; color:#ffffff; font-weight:bold; font-size:18px">  
                               <%-- <th scope="col" style="width: 04px; visibility:hidden">UserId 
                                </th> --%> 
                                 <th scope="col" style="width: 04px" >UserId 
                                </th> 
                                <th scope="col" style="width: 120px"><div style="margin-left:10px">Date &Time  </div>
                                </th>  
                                <th scope="col" style="width: 100px">Order ID
                                </th>  
                                <th scope="col" style="width: 80px">Full Order
                                </th>  
                              <%--  <th scope="col" style="width: 120px">Update Order
                                </th>  --%>
                               
                            </tr>  
                    </HeaderTemplate>    
                              
                      <ItemTemplate>
                          
                          <tr>
                              <%--<td><asp:Label ID="Labelid" Visible="false"  runat="server" Text='<%# Eval("UserId") %>'></asp:Label></td>--%>
                              <td><asp:Label ID="Labelid"   runat="server" Text='<%# Eval("UserId") %>'></asp:Label></td>
                              <td><asp:Label ID="LabelDT" runat="server" Text='<%# Eval("DT") %>'></asp:Label></td>
                              <td><asp:Label ID="Labeladdress" runat="server" Text='<%# Eval("OrderID") %>'></asp:Label></td>
                              <td><a href="AdminFullOrder.aspx?Userid=<%#Eval("Userid")%>" style="color:#cc0000;font-weight:bold" >View Full Order</a></td>
                                <%--  <td><a href="#" style="color:#cc0000; font-weight:bold">Update Order</a></td>--%>
                                   
                              </tr>
                                                 
                        </ItemTemplate>
                      <FooterTemplate>  
                        </table>  
                    </FooterTemplate>   
               

         </asp:Repeater>
</ContentTemplate>

                    </asp:UpdatePanel>

                    

Default.aspx.cs page
  protected void Timer1_Tick(object sender, EventArgs e)
    {
        Repeater1.DataBind();
    }

how to set auto refresh in asp.net grid view control
how to
set auto refresh in asp.net Repeater control
how to
set auto refresh in asp.net Datalist control
how to
set auto refresh in asp.net List view control


http://sradhawebcreations.com/

#SradhaWebCreations
Contact : +91-9040573923, +91-7008182025
http://sradhawebcreations.com/
http://sradhawebcreations.blogspot.in/
https://facebook.com/sradhawebcreations
https://www.facebook.com/Sradhawebeducation/

Friday, November 2, 2018

how to add edit and Delete image in asp.net Grid view Command Field | Sradha Webcreations

hoe to add Edit , Delete , Update & Cancel icon Image in asp.net Grid View Command Field

use this code in grid view 


 <asp:TemplateField>
                 <EditItemTemplate>
                     <asp:ImageButton ID="btnUpdate" runat="server" CommandName="Update" ImageUrl="~/image/thik.jpg" ToolTip="Update" />
                     <asp:ImageButton ID="btnCancel" runat="server" CommandName="Cancel" ImageUrl="~/image/crush.jpg" ToolTip="Cancel" />
                 </EditItemTemplate>
                 <ItemTemplate>
                     <asp:ImageButton ID="btnEdit" runat="server" CommandName="Edit" ImageUrl="~/image/edit.jpg" ToolTip="Edit Qty" />
                     <asp:ImageButton ID="btnDelete" runat="server" CommandName="Delete" ImageUrl="~/image/delete.jpg" ToolTip="Delte Item" />
                 </ItemTemplate>
             </asp:TemplateField>

delete this code in grid view 

 <%-- <asp:CommandField HeaderText="Cart Order"   ShowEditButton="True" EditText="add Qunatity" ItemStyle-Width="100" >
<ItemStyle Width="100px"></ItemStyle>
                                 </asp:CommandField>
                                   <asp:CommandField HeaderText="Delete Order" ShowDeleteButton="True" DeleteText="Delete Item" ItemStyle-Width="100"  >
<ItemStyle Width="100px"></ItemStyle>
                                 </asp:CommandField>--%>


        




how to add Delete icon image in asp.net grid view Command Field
how to add Edit icon image in asp.net grid view Command Field
how to add Cancel icon image in asp.net grid view Command Field
how to add Update icon image in asp.net grid view Command Field



http://sradhawebcreations.com/

#SradhaWebCreations
Contact : +91-9040573923, +91-7008182025
http://sradhawebcreations.com/
http://sradhawebcreations.blogspot.in/
https://facebook.com/sradhawebcreations
https://www.facebook.com/Sradhawebeducation/