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

  • Home
  • SEARCH
  • 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 6574987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:19:55+00:00 2026-05-25T15:19:55+00:00

I have an application page (in a SharePoint application, if that is relevant) with

  • 0

I have an application page (in a SharePoint application, if that is relevant) with a JQuery datepicker widget registered:

<script type="text/javascript">
    // Create JQuery calendar
    $(document).ready(function () {
        $('#<%=TextBoxDato.ClientID %>').datepicker({ altField: "#<%=TextBoxDato.ClientID %>",
            altFormat: 'dd/mm/yy'
        });

        $.datepicker.setDefaults($.datepicker.regional['no']);
    });
</script>


<asp:TextBox ID="TextBoxDato" runat="server" />
<asp:Button ID="ButtonSubmit" runat="server" text="Do it" />

In the code-behind, on page load I add a small client-side script to validate the filename and then populate the text box with today’s date:

// Add client-side script to check for existing file names
ButtonSubmit.Attributes.Add("onclick", "javascript:return checkFile()");

// Fill date box with today's date
DateTime now = DateTime.Now;

…then, in the event handler for a click to ButtonSubmit, I try to read out the value that the user selected:

DateTime now = DateTime.Parse(TextBoxDato.Text, new CultureInfo("fr-FR"));

My problem is that when clicking ButtonSubmit, the date that the user selected seems to be ignored in the code-behind – the value of ‘now’ is always today’s date. When running a debugger, the checkFilename() JavaScript method is able to access the picked date, but the code-behind is not. Does anyone see what I’m doing wrong?

  • 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-25T15:19:55+00:00Added an answer on May 25, 2026 at 3:19 pm

    You say

    In the code-behind, on page load I add a small client-side script to
    validate the filename and then populate the text box with today’s
    date:

    You are settings the TextBox value with the current date on page load. Put in some extra code on the Page_Load method

    VB

    If Not Page.IsPostBack Then
        '' assign the textbox value here
    End If
    

    c#

    if (!Page.IsPosBack) {
         // assign the textbox value here
    }
    

    Otherwise everytime you click the button, the value will reset to the page load value

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application with a launch page that needs to determine what is
I have a Tapestry application that is serving its page as UTF-8. That is,
I have a struts2 application with a single page that may show one of
I have a web application that has a page that loads the content from
I have one sharepoint custom page application which is rendering from a user control.
I have a custom web application that integrates with a SharePoint (MOSS 2007) solution.
I have an asp.net web application in c# script. I want this application page
I have an application page (aspx) deployed in the _LAYOUTS folder of MS SharePoint
I have a SharePoint 2010 web application that I'd like to use a custom
I have a home page in JSP of my MVC application that have some

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.