problem running jquery plug ins

I have a couple of dropdowns in a update panel.  I had the grid in a update panel.  When you click the grid to <commandArgument> I load the modal window.  My problem is if I can get the modal's text boxes to fill on grid click, then none of the plugins, IE watermark, or datepicker will work.   If I remove the grid and modal from the update panel the date pickers and stuff work, but then the textboxes wont fill.  Anyone run into this, and you can you tell me how to make this work, so that when they click the grid modal opens with a datepicker and the fields modal window fields are filled.  Here is the html and the vb code behind for when the grid is clicked.  Thanks in advance.
PS.  I have moved this stuff all over the place trying to make it work correctly.

<%@ Page Title="Carept & Vinyl Installations" Language="VB" MasterPageFile="~/MasterPages/Companion2015.master" AutoEventWireup="false" CodeFile="Carpet_VinylInstalled.aspx.vb" Inherits="Inspections_Carpet_VinylInstalled" %>
<%@ MasterType VirtualPath="~/MasterPages/Companion2015.master" %>
<%-- Add content controls here --%>
<asp:Content ContentPlaceHolderID="head" runat="server">
 
 <style type="text/css">
       .FormatRadioButtonList label
{
  margin-right: 15px;
  margin-left: -3px;
}
    body.modal-open .datepicker {
    z-index: 1200 !important;
}

 </style>
     <script src="../scripts/jquery-ui-1.11.2.js"></script>
    <script src="../Themes/jquery-ui-1.11.2.custom/jquery-ui.min.js"></script>
</asp:Content>


<asp:Content ContentPlaceHolderID="MainContent" runat="server">

    <p>&nbsp;</p>
    <br />
      <div class="container">
    <h3><%: Title%></h3>
          <hr />
  
       <%-- <asp:UpdatePanel runat="server" ID="pnlLocation" >
            <ContentTemplate>--%>
                <div class="row">
            <div class="col-sm-2">
                <asp:Label runat="server">Select Location:</asp:Label>
            </div>
            <div class="col-sm-4">
                <asp:DropDownList ID="ddLocations" runat="server" CssClass=" dropdown form-control" AutoPostBack="True" >
                </asp:DropDownList>

            </div>
        </div>
        <div class="row">
            <div class="col-sm-2">
                <asp:Label runat="server">Select Property:</asp:Label>
            </div>
            <div class="col-sm-4">
                <asp:DropDownList ID="ddProperties" runat="server" CssClass="dropdown form-control" AutoPostBack="True"  >
               </asp:DropDownList>
            </div>
        </div>
                <br />
            <div class="row">
                <div class="col-sm-4">
                    <asp:RadioButtonList runat="server" ID="ddType" CellPadding="30" RepeatDirection="Horizontal" CellSpacing="40" TabIndex="1" CssClass="FormatRadioButtonList" AutoPostBack="True">
                <asp:ListItem Text="Not Installed" Value="0" Selected="True"></asp:ListItem>
                <asp:ListItem Text="Installed" Value="1"></asp:ListItem>
            </asp:RadioButtonList>
                </div>
            </div>

          <br />      
          <%--  </ContentTemplate>
        </asp:UpdatePanel>--%>
        <div class="clearfix">

                </div>
                <br />
                
          <asp:UpdatePanel runat="server" ID="pnlRecords" UpdateMode="Conditional" >
             <Triggers>
                 <asp:AsyncPostBackTrigger ControlID="ddProperties" EventName="SelectedIndexChanged" />
             </Triggers>
              <ContentTemplate>
                  
    <div class="row">
        <div class="col-sm-12">
            <asp:GridView ID="gvRecords" runat="server" CssClass="table table-bordered table-striped table-responsive pagination-ys" AllowPaging="True" AutoGenerateColumns="False"
                                    EmptyDataText="No items have been found" EmptyDataRowStyle-ForeColor="Red" FooterStyle-HorizontalAlign="Left" FooterStyle-ForeColor="Red" AlternatingRowStyle-BackColor="#CCCCCC">
                                    <Columns>
                                        <asp:TemplateField HeaderText="ID" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="lblID" runat="server" Text='<%# Container.DataItemIndex %>' Visible="false"></asp:Label>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                    </FooterTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="WO No.">
                                    <ItemTemplate>
                                        <asp:Label ID="lblWONum" runat="server" Text='<%# Bind("wo_number") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                         <asp:TemplateField HeaderText="Create Date">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCreateDate" runat="server" Text='<%# Bind("CreatedDate", "{0:d}")%>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="BldgID">
                                    <ItemTemplate>
                                        <asp:Label ID="lblBldgID" runat="server" Text='<%# Bind("BldgID") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Unit ID">
                                    <ItemTemplate>
                                        <asp:Label ID="lblUnitID" runat="server" Text='<%# Bind("UnitID") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Room">
                                    <ItemTemplate>
                                        <asp:Label ID="lbRoom" runat="server" Text='<%# Bind("ItemGroup") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Description">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDescrption" runat="server" Text='<%# Bind("ItemDescription") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Qty">
                                    <ItemTemplate>
                                        <asp:Label ID="lblQty" runat="server" Text='<%# Bind("ItemQty") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Installed Date">
                                    <ItemTemplate>
                                        <asp:Label ID="lblInstalled" runat="server" Text='<%# Bind("InstalledDate", "{0:d}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                      </EditItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="LinkButton1" runat="server" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>'
                                            Height="20px" Width="30px" ImageUrl="../Images/Inventory1.jpg" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                                      
                </asp:GridView>

        </div>
    </div>
  
    
   
    <asp:HiddenField runat="server" ID="hfType" />
    <asp:HiddenField runat="server" ID="hfPropID" />
    <asp:HiddenField runat="server" ID="hfRoom" />
    <asp:HiddenField runat="server" ID="hfRoomDesc" />
<div class="clearfix"></div>

        <div class="modal " id="EntryScreen" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                     <asp:HiddenField runat="server" ID="hfID" />
   
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="false">Close</button>
                 
                        <div class="row">
                            <div class="col-xs-2">
                                <asp:Label runat="server" >Bldg ID:</asp:Label>
                                
                            </div>
                            <div class="col-xs-6">
                                <asp:Label runat="server" ID="modBldgID" Font-Italic="true" ></asp:Label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-2">
                                <asp:Label runat="server" >Unit ID:</asp:Label>
                                
                            </div>
                            <div class="col-xs-6">
                                <asp:Label runat="server" ID="modUnitID" Font-Italic="true" CssClass="control-label"></asp:Label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-2">
                                <asp:Label runat="server" >Description:</asp:Label>
                                
                            </div>
                            <div class="col-xs-6">
                                <asp:Label runat="server" ID="modDesc"  Font-Italic="true"></asp:Label>
                            </div>
                        </div>
                         <div class="row">
                            <div class="col-xs-2">
                                <asp:Label runat="server" >Work Order:</asp:Label>
                              

                            </div>
                             <div class="col-xs-6">
                                   <asp:Label runat="server" ID="modWorkOrderNo" Font-Italic="true"></asp:Label>
                             </div>
                        </div>

                    </div>
                    <div class="modal-body">
                       
                        
                        <div class="row">
                            <div class="col-xs-3">
                                <asp:Label runat="server">Install Date:</asp:Label>

                            </div>
                            <div class="col-xs-9">
                                <asp:TextBox runat="server" ID="modInstallDate" CssClass="form-control datepicker "></asp:TextBox>
                                 <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="modInstallDate" ErrorMessage="Install Date is Required" text="*"
                                SetFocusOnError="True" ValidationGroup="Submit">*</asp:RequiredFieldValidator>
                            </div>
                          
                            

                        </div>
                          <div class="row">
                                <div class="col-xs-3">
                                <asp:label runat="server">Installed By:</asp:label>
                            </div>
                            <div class="col-xs-6">
                                <asp:textbox  runat="server" ID="modInstallBy" CssClass="form-control"></asp:textbox>
                            </div>
                            </div>
                        
                        <div class="row">
                            <div class="col-xs-3">
                                <asp:label runat="server">Manufacturer:</asp:label>
                            </div>
                            <div class="col-xs-6">
                                <asp:TextBox runat="server" ID ="txtManufacturer" CssClass="form-control"></asp:TextBox>
                            </div>
                            

                            </div>
                        <div class="row"> 
                                
                                 <div class="col-xs-3">
                                <asp:label runat="server">Color:</asp:label>

                            </div>
                            <div class="col-xs-6">
                                <asp:TextBox runat="server" ID="modColor" CssClass="form-control">

                                </asp:TextBox>
                            </div>
                          
                        </div>
                    </div>
                    <div class="modal-footer">
                        <div class="row">
                            <div class="col-xs-6">
                                <asp:Button runat="server" ID="btnSave" Text="Save" CssClass="btn-success ui-button" />
                                &nbsp;
                                <asp:Button runat="server" ID="btnCancel" Text="Cancel" CssClass="btn-danger ui-button" />
                            </div>
                        </div>
                    </div>
                </div>

                </div>
            </div>



                   <script type="text/javascript">
                       $(document).ready(function () {
                           $('.datepicker').datepicker();
                       });

                      $('#MainContent_modColor').watermark('mm/mm/yyyy')
                           </script>
              </ContentTemplate>
          </asp:UpdatePanel>
                 
                  





 
        </div>


    
    
   

    


    


   
</asp:Content>

Open in new window


 Protected Sub gvRecords_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles gvRecords.RowCommand
        Dim i As Integer = e.CommandArgument
        Dim cndName As String = e.CommandName
        Dim ds As New DataSet
        Dim myLabel As New Label
        myLabel = CType(Page.FindControl("modWorkOrderNo"), Label)
        If e.CommandName = "Page" Then
        Else
            ds = CType(Session("dsInstalled"), DataSet)
            modBldgID.Text = ds.Tables(0).DefaultView.Item(i).Item("BldgID").ToString
            modUnitID.Text = ds.Tables(0).DefaultView.Item(i).Item("UnitID").ToString
            modWorkOrderNo.Text = ds.Tables(0).DefaultView.Item(i).Item("WO_Number").ToString
            hfID.Value = ds.Tables(0).DefaultView.Item(i).Item("ID")
            hfPropID.Value = ds.Tables(0).DefaultView.Item(i).Item("PropertyID").ToString
            modDesc.Text = ds.Tables(0).DefaultView.Item(i).Item("ItemDescription").ToString + "-" + ds.Tables(0).DefaultView.Item(i).Item("ItemGroup").ToString
            If UCase(ds.Tables(0).DefaultView.Item(i).Item("ItemGroup").ToString) = "APARTMENT" Then
                hfRoom.Value = ds.Tables(0).DefaultView.Item(i).Item("ItemDescription").ToString
            Else
                hfRoomDesc.Value = ds.Tables(0).DefaultView.Item(i).Item("ItemGroup").ToString + "-" + ds.Tables(0).DefaultView.Item(i).Item("ItemDescription").ToString
            End If
            '   pnlRecords.Update()
            ScriptManager.RegisterStartupScript(Page, Me.GetType(), "ClientScript", "$('#EntryScreen').modal('show');", True)

        End If

    End Sub

Open in new window

mgmhicksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Najam UddinCommented:
Update panel regenerates html on load,  somehow it misses datepicker and similar control, solution is to regenerate them after update panel refresh

$(document).ready(function() {
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
            function EndRequestHandler(sender, args) {
                $('.mydatepickerclass').datepicker({ dateFormat: 'dd-mm-yy' });
            }
        });
0
mgmhicksAuthor Commented:
That didn't work for me.  If I remove the the modal window from the update panel, I can get the datepicker, but then the fields on the modal window do not update.   How do I get around that.
0
Najam UddinCommented:
try adding this at end of page

function pageLoad(sender, args) {
        if (args.get_isPartialLoad()) {
           $('.mydatepickerclass').datepicker({ dateFormat: 'dd-mm-yy' });
        }
    }
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mgmhicksAuthor Commented:
sorry Najam that is not working either.
0
mgmhicksAuthor Commented:
That did end up working for me, forgot to make the textbox part of the class.  All is good thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.