Last post Feb 29, 2012 12:13 PM by obedrodriguez
Feb 22, 2012 12:22 PM|obedrodriguez|LINK
I have a web application working perfect on development and staging enviroments, but on production enviroment its not working. The IsPostBack always return false. When select, press any control that do a post back the IsPostBack always return false. Every
time the page get hit, no matter if it is the first time or post back, the IsPostBack property always returns False.
The wierd thing is that the error is in production enviroment and not in staging and development enviroments. I did my research on google and i found nothing similar to my case.
If Not IsPostBack then
Feb 22, 2012 12:36 PM|Ruchira|LINK
See the following thread and check whether your situation is same as his
My Tech blog | My YouTube Channel
Feb 22, 2012 12:40 PM|kedarrkulkarni|LINK
that should not happen in default scenario...
or are you inheriting codebehind page from some other custom page rather than System.Web.UI.Page?
or is the problem is something like this
hope this helps...
Feb 22, 2012 12:49 PM|obedrodriguez|LINK
Feb 22, 2012 12:52 PM|mathieub|LINK
I think the difference should be found on the server itself.
Is it the same OS ?
Is it the same IIS ?
No Load Balancing ?
What do you try to do ? Send information to a Sql Server ? Data Binding ?
Feb 22, 2012 01:11 PM|obedrodriguez|LINK
What im trying to do is simple polulates dropdown getting data from Sqlserver and Loadinformation to display it.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Feb 22, 2012 01:54 PM|kedarrkulkarni|LINK
on first load of page, see the source html in browser..... does it have hidden field named __VIEWSTATE
this should be there for IsPostBack to work fine...
Feb 22, 2012 02:08 PM|obedrodriguez|LINK
Yes there is
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY3MDc4NjAzMQ9kFgJmD2QWAgIDD2QWBAIDDzwrAA0CAA8WAh4LX.........../>
Feb 22, 2012 04:05 PM|obedrodriguez|LINK
Guys, I added a single page to test in production enviroment with a button nothing else and the apllication do the same.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Me.Button1.Text = "Yes"
Me.Button1.Text = "NO"
Im getting always "YES"
Please GUYS Help. I dont KNOW Could a confuguration on IIS.
Feb 22, 2012 04:09 PM|Ruchira|LINK
Did you contact your hosting provider already? If not, please do contact them. Also, have you set action property for your form tag? Can I see your HTML markup too?
Feb 22, 2012 04:26 PM|obedrodriguez|LINK
This the test page...
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestingPostback.aspx.vb" Inherits="CCCProtected.TestingPostback" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" />
Feb 22, 2012 04:29 PM|obedrodriguez|LINK
This is the result "view source"
<form name="form1" method="post" action="testingpostback.aspx" id="form1">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMjA0OTM4MTAwNA9kFgICAw9kFgICAQ8PFgIeBFRleHQFBUVudHJvZGRkjCVKIVgwzy+0olezbbegooFpEV4=" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLA/4KyCwKM54rGBjH0dcCVqDsHgtjxEnoeXKVEmHdf" />
<input type="submit" name="Button1" value="Yes" id="Button1" />
Feb 23, 2012 11:27 AM|obedrodriguez|LINK
Feb 23, 2012 10:56 PM|rossisdead2|LINK
Are you testing the development and production sites from the same machine and browser?
Feb 24, 2012 01:41 AM|markfitzme|LINK
Can you check and see if the event handlers for the buttons are firing properly? If not then that could be a hint as button may not have it's event handler wired up, hence it's not calling the DoPostback functions from the client, and then not getting postback
in the server.
Is this a web application project or a website project? There may be a difference that occurs during publishing and things could vary based upon which type of project it is.
Feb 29, 2012 12:05 PM|obedrodriguez|LINK
Yes im using the same machine and browser, this is wierd
Feb 29, 2012 12:13 PM|obedrodriguez|LINK
The app works perfect, locally, in development enviroment(another server) and in stagining enviroment(another server). The problem is in production. Based on the pages and extra code i created for debuging purposes (you know we cant debug the code on production)
its simple. The IsPostBack always false!. This is a web application project.