Solved

Invalid Postback query on ASP page

Posted on 2009-03-31
5
368 Views
Last Modified: 2013-12-17
Greetings all

I have a calendar control that displays events for the day in a listbox.

I click on a  hyperlink and go to a page. When I return = no problem.

If I scroll the calendar to the previous month and select a day, and repeat the exercise, when I return to the page I get an "Invalid postback or callback argument".

Snippet include MasterPage SOurce, Default Page Source, Default Page Code Behind)

Where do I start?


In advance, thanks!

   allanmark
MASTER PAGE:
 
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MimeMaster01.master.cs" Inherits="MimeMaster01" %>
<!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 id="Head1" runat="server">
    
    <title>Mime Master</title>
    
     <link id="cssLink" rel="stylesheet" type="text/css" runat="server"
    href="CSS/Mime.CSS" />  
    
</head>
 
<body id="MasterBody" runat="server" >
 
<form id="form1" runat="server" style="height: 100%;">
    
<div id="container" >
 
    <a name="theTop" ></a>  
    
	<div id="header">
	<!-- Header start -->		  
          		  
		  <ajaxext:ScriptManager ID="scriptmanager1" runat="server">
          </ajaxext:ScriptManager>          
          
          <asp:LoginName  ID="lgUser" runat="server" CssClass="loginName" FormatString="Member: {0}"/>
          
          <center>
		  <h1>Marriage Encounter - Western Cape</h1>
		  <h5>(Administration Management)</h5>
          </center>
          
          <asp:Label ID="lblFollowup" runat="server" CssClass="followup" Visible="false">** Follow-ups Outstanding **</asp:Label>
                         
          <asp:Image ID="headerPict" runat="server" CssClass="headerPic" ImageUrl="~/Graphics/ME05.Gif" />
 
          <center><ul id='menu' style="width: 67%">
                <li ><a href='<%=ResolveUrl("Default.aspx")%>'  id='menuHome' >Home</a></li>
                <li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuPeople' >People</a></li>
                <li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuCircles' >Circles</a></li>
                <li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuWeekends' >Weekends</a></li>
                <li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuEvents' >Events</a></li>
                <li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuGeneral' >General</a></li>
                <li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuPortfolios' >Portfolio</a></li>
                <li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuUsers' >Users</a></li>
              </ul>
              
              <asp:LoginStatus ID="logOn" runat="server" CssClass="loginStat" />              
            <!-- Give a little space -->
            <div style="height:15px"></div>
 
              <hr  width="96%" class="redline"/>
          </center>
 
          
	<!-- Header end -->
	</div>
	
	<div id="body">
    <!-- Body start -->
    
	    <div id="dummy" style="position:relative; height: 40px"></div>
		
        <div id="wrapperDiv" class="wrapper"> 	
	  
	    <div id="left" class="leftnav">	
		       <asp:ContentPlaceHolder ID="leftnav" runat="server">
                </asp:ContentPlaceHolder>
        </div>
        
        <div id="right" class="rightnav">	
              <asp:ContentPlaceHolder ID="righnav" runat="server">
              </asp:ContentPlaceHolder>
        </div>
      
      <!-- <div id="wrapper"> 	 -->
      </div>
        
        <!-- Give a little space -->
        <div style="height:45px"></div>
        
    <!-- Body end -->
	</div>
	
	<div id="footer">
	<!-- Footer start -->
	
		  <center><hr width="75%" class="redline" /></center>
		  
		  <!-- Give a little space -->
          <div style="height:10px"></div>
		  
		  <center><a href="#theTop" class="anchor"  >Back to top</a></center>
		  
		  <br />
          <center>Marriage Encounter Western Cape &reg; is a registered trademark of Marriage Encounter Western Cape, Inc<br />
          &copy; 2009 Marriage Encounter Western Cape, Inc.
          </center>            
        
	<!-- Footer end -->
	</div>    
 
<!-- Div: "Container"  end -->
</div>
 
</form>
 
</body>
 
</html>
 
 
DEFAULT PAGE:
 
<%@ Page Language="C#" MasterPageFile="~/MimeMaster01.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="leftnav" Runat="Server">
 
    <ajaxext:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </ajaxext:ScriptManagerProxy>
 
    <center>
    <asp:HyperLink  ID="hypContacts" runat="server" CssClass="hypLink" NavigateUrl="~/Miscellaneous/Contacts.aspx" >Contacts</asp:HyperLink>
    </center>   
    <br />
    <br />
 
    <ajaxext:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
         
        <center>
        <asp:Calendar ID="calEvents" runat="server" BackColor="White" BorderColor="#999999"
            CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
            ForeColor="Black" Height="180px" Width="200px" OnSelectionChanged="calEvents_SelectionChanged">
            <SelectedDayStyle BackColor="#ffc0cb" Font-Bold="True" ForeColor="White"  />
            <TodayDayStyle BackColor="#ffc0cb" ForeColor="Black" />
            <SelectorStyle BackColor="#CCCCCC" />
            <WeekendDayStyle BackColor="#CD8C95" />
            <OtherMonthDayStyle ForeColor="#808080" />
            <NextPrevStyle VerticalAlign="Bottom" />
            <DayHeaderStyle BackColor="#ffb6c1" Font-Bold="True" Font-Size="7pt" />
            <TitleStyle BackColor="#ffc0ca" BorderColor="Black" Font-Bold="True" />
        </asp:Calendar>
        </center>
        
        <br />
        <center>
        <h5 class="h5header" >Events for the day:</h5>
        <asp:ListBox ID="lbxEvents" runat="server" CssClass="listbox" ></asp:ListBox>
        </center>
        
    </ContentTemplate>
    </ajaxext:UpdatePanel>
    
 
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="righnav" Runat="Server">
    <asp:TextBox ID="TextBox1" runat="server" Style="z-index: 100; left: 0px; position: absolute;
        top: 0px"></asp:TextBox>
    
    <asp:Button ID="Button1" runat="server" Text="Button" />
    
</asp:Content>
 
 
DEFAULT PAGE - CODE BEHIND:
 
using System;
using System.Data;
using System.Text;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BusinessLogic;
using DataTransferObjects;
 
public partial class _Default : System.Web.UI.Page
{
    private List<ME_Event> dailyEvents;
 
    private bool loggedIn;
 
    protected void Page_Load(object sender, EventArgs e)
    {
        // Load the Page-specific stylesheet.
        HtmlLink lnk = (HtmlLink)Master.FindControl("cssLink");
        if (lnk != null)
            lnk.Href = "~/CSS/Default.css";
 
        if (Page.IsPostBack)
        {
            if (Session["loggedIn_Session"] != null)
            {
                if ((bool)Session["loggedIn_Session"] != User.Identity.IsAuthenticated)
                {
                    loggedIn = User.Identity.IsAuthenticated;
                    Session["loggedIn_Session"] = loggedIn;
                    FetchDailyEvents();
                }
                else
                {
                    loggedIn = (bool)Session["loggedIn_Session"];
                }
            }
            else
            {
                loggedIn = User.Identity.IsAuthenticated;
                Session["loggedIn_Session"] = loggedIn;
                FetchDailyEvents();
            }
        }
        else
        {
            // Not PostBack
            if (Session["loggedIn_Session"] != null)
                loggedIn = (bool)Session["loggedIn_Session"];
            else
                loggedIn = User.Identity.IsAuthenticated;
 
            if (Session["selectedDate_Session"] != null)
            {
                calEvents.SelectedDate = (DateTime)Session["selectedDate_Session"];
            }
            else
            {
                //calEvents.SelectedDate = DateTime.Now;
                calEvents.SelectedDate = calEvents.TodaysDate;
            }
           
            FetchDailyEvents();
        }
 
    }
 
    protected void calEvents_SelectionChanged(object sender, EventArgs e)
    {
        FetchDailyEvents();
 
    }
 
    private void FetchDailyEvents()
    {
        lbxEvents.DataSource = "";
        dailyEvents = null;
 
        if (loggedIn)
        {
            dailyEvents = BusinessLogic.Business.GetEvents(calEvents.SelectedDate, "Y");
        }
        else
        {
            dailyEvents = BusinessLogic.Business.GetEvents(calEvents.SelectedDate, "N");
        }
 
        lbxEvents.DataSource = dailyEvents;
        lbxEvents.DataTextField = "Title";
        lbxEvents.DataValueField = "Id";
        lbxEvents.DataBind();
 
        Session["selectedDate_Session"] = calEvents.SelectedDate;
 
//        Session["dailyEvents_Session"] = dailyEvents;
    }
 
 
}

Open in new window

0
Comment
Question by:allanmark
  • 3
5 Comments
 
LVL 7

Expert Comment

by:jkdt0077
ID: 24036964
If I'm not mistaken this is ASP.NET and not ASP.

I think this is the wrong zone.
0
 

Author Comment

by:allanmark
ID: 24036971
Interesting!!

Tried it with IEplorer and it's fine. So Firefox is giving hassles.
0
 

Author Comment

by:allanmark
ID: 24036975
Tks! Missed that!

How do I change zones?
0
 

Accepted Solution

by:
allanmark earned 0 total points
ID: 24042273
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question