Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6648003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:36:16+00:00 2026-05-26T00:36:16+00:00

I am trying to get the client name of a control so I can

  • 0

I am trying to get the client name of a control so I can use a jqueryUI function on it.

<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" ShowFooter="True" 
    AutoGenerateColumns="False">
    <Columns>
        <asp:TemplateField HeaderText="Date">
            <FooterTemplate>
                <asp:TextBox ID="DateField" runat="server"></asp:TextBox>
                     <script type="text/javascript">
                         $(document).ready(function () {
                             $('#<%=DateField.ClientID %>').datepicker();
                         });
                    </script>
            </FooterTemplate>

I get an error message

CS0103: The name 'DateField' does not exist in the current context 

Now according to some of the other post, the issue is that the field is not registered in the designer. Currently the only two fields registered in the designer are form1 and GridView1. If I attempt to add the field manually I get the error

Object reference not set to an instance of an object.

Which makes sense in a way. I geuss the question is how are form1 and Gridview1 being initialized. Also now if I make any modifications to the page my variable disappears.

So what is the correct way to wireup a datepicker to a textbox inside a grid?

Note I have moved my script block from the header, to the end, to inside the template field all with no change.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:36:17+00:00Added an answer on May 26, 2026 at 12:36 am
    <asp:TextBox ID="TextBox1" runat="server" CssClass="date"></asp:TextBox>   
    

    and in script

     $(document).ready(function () {
          $(".date").datepicker();
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a iOS client to make use of Yammer's Oauth2 to
I'm currently trying to get a simple client \ server websocket demo up and
I'm trying to get a simple socket.io server running: Client: <script src=http://www.my-server.com:8080/socket.io/socket.io.js></script> var socket
I'm trying to get client validation working on my asp.net mvc 2 web application
we have change the server of our client, i'm trying to get rid of
I'm trying to get client-side javascript objects saved as a file locally. I'm not
I'm trying to get a certain cookie in a java client by creating a
I'm trying to get a FacebookLoginTest running. Problem is: the Symfony2 client does not
I trying to get a file from an FTP server using ftp_get from PHP
I'm trying to reset my form using javascript on client side. The code looks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.