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.
Im NOT using ajax, jquery, javascript, other controls. The page inherits from System.Web.UI.Page(like normal).
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"
Else
Me.Button1.Text = "NO"
End If
End Sub
Im getting always "YES"
Please GUYS Help. I dont KNOW Could a confuguration on IIS.
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?
obedrodrigue...
Member
38 Points
27 Posts
IsPostBack always false in production server and and not in staging and development enviroments
Feb 22, 2012 12:22 PM|LINK
Hello guys,
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.
Im NOT using ajax, jquery, javascript, other controls. The page inherits from System.Web.UI.Page(like normal).
If Not IsPostBack then
'simple code
End If
Ruchira
All-Star
42888 Points
7020 Posts
MVP
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 12:36 PM|LINK
Hello,
See the following thread and check whether your situation is same as his
http://forums.asp.net/t/1186507.aspx/1/10
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.kedarrkulkar...
All-Star
34055 Points
5479 Posts
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 12:40 PM|LINK
that should not happen in default scenario...
are you directing user to same page from javascript? like location.href
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
http://www.latifozturk.com/post/IsPostBack-was-always-false-after-installing-NET-Framework-35-SP1.aspx
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
obedrodrigue...
Member
38 Points
27 Posts
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 12:49 PM|LINK
Guys it a simple page. Im NOT using ajax, jquery, javascript, other controls. The page inherits from System.Web.UI.Page(like normal).
mathieub
Member
250 Points
55 Posts
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 12:52 PM|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 ?
obedrodrigue...
Member
38 Points
27 Posts
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 01:11 PM|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
'Populate Dropdowns
cmbCountry_Bind()
cmbSourceInfo_Bind()
LookupUserAndLoadInformation(My.User.Name)
End If
End sub
kedarrkulkar...
All-Star
34055 Points
5479 Posts
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 01:54 PM|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...
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
obedrodrigue...
Member
38 Points
27 Posts
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 02:08 PM|LINK
Yes there is
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY3MDc4NjAzMQ9kFgJmD2QWAgIDD2QWBAIDDzwrAA0CAA8WAh4LX.........../>
obedrodrigue...
Member
38 Points
27 Posts
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 04:05 PM|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"
Else
Me.Button1.Text = "NO"
End If
End Sub
Im getting always "YES"
Please GUYS Help. I dont KNOW Could a confuguration on IIS.
Ruchira
All-Star
42888 Points
7020 Posts
MVP
Re: IsPostBack always false in production server and and not in staging and development envirome...
Feb 22, 2012 04:09 PM|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?
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.