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 7617539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:10:32+00:00 2026-05-31T03:10:32+00:00

Okay, so I have this page, which has one Ajax:AsyncFileUploader also some other ajax

  • 0

Okay, so I have this page, which has one Ajax:AsyncFileUploader also some other ajax stuff like ModelPopUpExtender etc. The problem is the two buttons in the page, of Cancel and Submit, both of them firing up but none is posting back, while I made sure none of the fields in the page are blank.

I know the events are firing up, because I debugged the JavaScript in Firebug (a single step into and continue process took more than 4 min, while I was just almost held the F10 key for stepping into, down!)

If anyone wants code, please tell me I’d post it, but buttons are just in normal code so nothing special, that’s why I am not posting the code, but in case required I can post entire page’s code (which is pretty long I’d tell you, not really though, but at least just for posting purpose in here, somewhat around 200 lines).
Any help anyone?

Edit: As per comment I am posting the code
code: aspx page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
    Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Detailed Reminder</title>
    <link href="StyleSheets/Default.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">

        function FileUploaded(sender, args) {
            var filename = args.get_fileName();
            var contentType = args.get_contentType();
            var text = "Size of " + filename + " is " + args.get_length() + " bytes";
            if (contentType.length > 0) {
                text += " and content type is '" + contentType + "'.";
            }
            $get('LabelStatusUpload').innerHTML = "File Uploaded Successfully";
        }

        function UploadStarted(sender, args) {
            $get('LabelStatusUpload').innerHTML = "Upload Started";
        }

        function ErrorUploaded(sender, args) {
            $get('LabelStatusUpload').innerHTML = "Some Error Occured";
        }

    </script>

</head>
<body>
    <form id="Form1" runat="server">
    <ajax:ToolkitScriptManager ID="SM1" runat="server">
    </ajax:ToolkitScriptManager>
    <asp:Button ID="Temp1" runat="server" Text="clear" />
    <div id="UpperContainer">
        <asp:Panel ID="PanelOuter" runat="server">
            <asp:Table ID="TableDetailedRemidner" runat="server">
                <asp:TableRow ID="TableRowName" runat="server">
                    <asp:TableCell ID="TableCell1" runat="server">
                        <asp:Label ID="LabelName" runat="server" AssociatedControlID="txtName" Text="Name"></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell2" runat="server">
                        <asp:TextBox ID="txtName" runat="server" ToolTip="Name of the user to send the mail to"></asp:TextBox>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="TableRowEmail" runat="server">
                    <asp:TableCell ID="TableCell3" runat="server">
                        <asp:Label ID="LabelEmail" runat="server" AssociatedControlID="txtEmail1" Text="Email 1"></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell4" runat="server">
                        <asp:TextBox ID="txtEmail" runat="server" Width="560px"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="regexEmailValidator" runat="server" ControlToValidate="txtEmail"
                            Display="Dynamic" Text="Invalid Email" ValidationExpression="\w+([-+.’]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="TableRowSubject" runat="server">
                    <asp:TableCell ID="TableCell5" runat="server">
                        <asp:Label ID="LabelSubject" runat="server" AssociatedControlID="txtSubject" Text="Subject"></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell6" runat="server">
                        <asp:TextBox ID="txtSubject" runat="server" AutoComplete="off" Width="560px"></asp:TextBox>
                        <asp:Panel ID="PanelDefaultSubjects" runat="server">
                            <div>
                                <asp:UpdatePanel ID="UpdatePanelSubject" runat="server">
                                    <ContentTemplate>
                                        <asp:RadioButtonList ID="RadioSubjectList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadioSubjectList_SelectedIndexChanged">
                                            <asp:ListItem Text="Submit the reports"></asp:ListItem>
                                            <asp:ListItem Text="prepare the presentation"></asp:ListItem>
                                            <asp:ListItem Text="Custom" Value=""></asp:ListItem>
                                        </asp:RadioButtonList>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                        </asp:Panel>
                        <ajax:PopupControlExtender ID="PCESubject" runat="server" TargetControlID="txtSubject"
                            PopupControlID="PanelDefaultSubjects" CommitProperty="value" Position="Right"
                            OffsetX="5" CommitScript="e.value" />
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="TableRowMessage" runat="server">
                    <asp:TableCell ID="TableCell7" runat="server">
                        <asp:Label ID="LabelMessageBody" runat="server" AssociatedControlID="txtMessageBody"
                            Text="Message"></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell8" runat="server">
                        <asp:TextBox ID="txtMessageBody" runat="server" Columns="40" Rows="10" Multiline="true"></asp:TextBox>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="TableRowFileUpload" runat="server">
                    <asp:TableCell ID="TableCell9" runat="server">
                        <asp:Label ID="LabelFileAttached" runat="server" AssociatedControlID="AsyncFileUpload1"
                            Text="Attach a file"></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell10" runat="server">
                        <ajax:AsyncFileUpload ID="AsyncFileUpload1" runat="server" OnClientUploadComplete="FileUploaded"
                            OnClientUploadError="ErrorUploaded" OnClientUploadStarted="UploadStarted" OnUploadedComplete="File_Uploaded"
                            UploaderStyle="Modern" ThrobberID="LabelThobber" />
                        <asp:Label ID="LabelThobber" runat="server" Style="display: none"><img alt="" src="Images/uploading.gif" /></asp:Label><br />
                        <asp:Label ID="LabelStatusUpload" runat="server" Text="    "></asp:Label>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="TableRowDueDate" runat="server">
                    <asp:TableCell ID="TableCell11" runat="server">
                        <asp:Label ID="LabelDueDate" runat="server" AssociatedControlID="txtDueDate" Text="Due Date"></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell12" runat="server">
                        <asp:TextBox ID="txtDueDate" runat="server" Width="560px"></asp:TextBox>
                        <ajax:MaskedEditExtender runat="server" ID="MEEDueDate" TargetControlID="txtDueDate"
                            Mask="99/99/9999" AutoComplete="true" MaskType="Date">
                        </ajax:MaskedEditExtender>
                        <ajax:MaskedEditValidator ID="MEVDueDate" runat="server" ControlExtender="MEEDueDate"
                            ControlToValidate="txtDueDate" IsValidEmpty="False" EmptyValueMessage="Due Date is required"
                            InvalidValueMessage="Due Date is required" EmptyValueBlurredText="*" InvalidValueBlurredMessage="*"
                            MaximumValueBlurredMessage="*" MinimumValueBlurredText="*" Display="Dynamic" />
                        <ajax:CalendarExtender ID="CalDueDate" runat="server" TargetControlID="txtDueDate">
                        </ajax:CalendarExtender>
                    </asp:TableCell></asp:TableRow>
                <asp:TableRow ID="TableRowFrequency" runat="server">
                    <asp:TableCell ID="TableCell17" runat="server">
                        <asp:Label ID="LabelFrequency" runat="server" AssociatedControlID="txtFrequency"
                            Text="Frequency"></asp:Label>
                    </asp:TableCell><asp:TableCell ID="TableCell18" runat="server">
                        <asp:TextBox ID="txtFrequency" runat="server"></asp:TextBox>
                        <asp:Panel ID="PanelFrequency" runat="server">
                            <div>
                                <asp:UpdatePanel ID="UpdatePanelFrequency" runat="server">
                                    <ContentTemplate>
                                        <asp:RadioButtonList ID="RadioButtonFrequency" runat="server" AutoPostBack="true"
                                            OnSelectedIndexChanged="RadioSubjectFrequency_SelectedIndexChanged">
                                            <asp:ListItem Text="15 min"></asp:ListItem>
                                            <asp:ListItem Text="6 hr"></asp:ListItem>
                                            <asp:ListItem Text="24 hr"></asp:ListItem>>
                                        </asp:RadioButtonList>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                        </asp:Panel>
                        <ajax:PopupControlExtender ID="PCEFrequency" runat="server" TargetControlID="txtFrequency"
                            PopupControlID="PanelFrequency" CommitProperty="value" Position="Right" OffsetX="5"
                            CommitScript="e.value" />
                    </asp:TableCell></asp:TableRow>
                <asp:TableFooterRow>
                    <asp:TableCell ID="TableCellSubmit" runat="server">
                        <asp:Button ID="BtnSubmit" runat="server" OnClick="Submit_Click" Text="Set Reminder Detailed" />
                    </asp:TableCell><asp:TableCell ID="TableCellCancel" runat="server">
                        <asp:Button ID="BtnCancel" runat="server" OnClick="Cancel_Click" Text="Cancel" />
                    </asp:TableCell></asp:TableFooterRow>
            </asp:Table>
        </asp:Panel>
    </div>
    </form>
</body>
</html>

Code : page_Behind.aspx.cs

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;

public partial class _Default : System.Web.UI.Page
{
    //static protected string savePath;
    //static protected int curFileSize;
    //static protected bool IsFileAttached;

    protected void Page_Load(object sender, EventArgs e)
    {
        CalDueDate.StartDate = DateTime.Now.Date;
        CalDueDate.EndDate = DateTime.Now.Date.AddYears(1);
        MEVDueDate.MinimumValue = DateTime.Now.Date.ToShortDateString();
        MEVDueDate.MaximumValue = DateTime.Now.Date.ToShortDateString();
    }

    protected void RadioSubjectList_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(RadioSubjectList.SelectedValue))
        {
            // Popup result is the selected task
            PCESubject.Commit(RadioSubjectList.SelectedValue);
        }
        else
        {
            // Cancel the popup
            PCESubject.Cancel();
        }
        // Reset the selected item
        RadioSubjectList.ClearSelection();
    }

    protected void RadioSubjectFrequency_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(RadioButtonFrequency.SelectedValue))
        {
            PCEFrequency.Commit(RadioButtonFrequency.SelectedValue);
        }
        else
        {
            PCEFrequency.Cancel();
        }
        RadioButtonFrequency.ClearSelection();
    }

    protected void File_Uploaded(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
    {
        if (AsyncFileUpload1.HasFile)
        {
            string savePath = MapPath("~/Uploads/") + Path.GetFileName(DateTime.Now.Month + DateTime.Now.Day + " "
                                                                            + DateTime.Now.Hour + DateTime.Now.Minute + " " + e.FileName);
            AsyncFileUpload1.SaveAs(savePath);
        }
    }

    protected void Submit_Click(object sender, EventArgs e)
    {
        // On Submit button doesn't even reaches here, debugged and breakpoint on any of following code is never reached
        int lastID = BusinessLayer.DetermineLastDetailedID();
        // Some other logic unimportant at this point
        BusinessLayer.AddDReminder(sender, e);
    }

    protected void Cancel_Click(object sender, EventArgs e)
    {
        txtName.Text = "";
        txtEmail1.Text = "";
        txtEmail2.Text = "";
        txtEmail3.Text = "";
        txtSubject.Text = "";
        txtMessageBody.Text = "";
        txtDueDate.Text = "";
        txtFrequency.Text = "";

    }

}
  • 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-31T03:10:34+00:00Added an answer on May 31, 2026 at 3:10 am

    I copied your code, experienced the problem, fixed it and now the postback is happening just fine. MEVDueDate is always saying “IsValid=false” and because of that the PostBack was not getting to Page_Load (that is the expected behavior of that validator).

    You need to change:

    MEVDueDate.MinimumValue = DateTime.Now.Date.ToShortDateString();
    MEVDueDate.MaximumValue = DateTime.Now.Date.ToShortDateString();
    

    with this:

    MEVDueDate.MinimumValue = DateTime.Now.Date.ToString("MM/dd/yyyy");
    MEVDueDate.MaximumValue = DateTime.Now.Date.ToString("MM/dd/yyyy");
    

    Select today on the calendar for Due Date, click cancel button and you should have a full postback. Please see that you are saying that min and max allowed dates are both today, so today is the only valid date that will allow the post-back to fire.

    The reason is that your calendar picker writes on the textbox “03/08/2012” but the ToShortDateString() retrieves a string with another date format. You end up comparing “03/08/2012” with “08/03/2012”.

    You need to make sure the date format you use to set MEVDueDate.MinimumValue is according to the format that calendarPicker (CalDueDate) puts in txtDueDate.

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

Sidebar

Related Questions

I have a page which uses jQuery for some AJAX-stuff und Django as main
Okay, I have this code: <script language=javascript type=text/javascript> <!-- function requestPage(page) { var request
Okay this question is very simple: I have a facebook page, and a website.
Okay so I have this mode: class Posts(db.Model): rand1 = db.FloatProperty() #other models here
I have a bunch of smilies in a page, which on click has to
I have this extremely simple splash page here: http://iph0wnz.com It has the main graphic
Okay, this has been absolutely infuriating to debug, I have finally figured out what
Okay this is a real headscratcher. I have an application which calls a web
Okay, I'm building an extension like so: has a browseraction which invokes a popup.html
I have a string which I store book pages. It's something like this: ///0///

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.