I have a 4.7.0 basic Runway site installed, and all I have chaged from the default is the inclusion of a couple of .Net user controls. The controls are fairly simple data grids, one with a paging control and another with a drop-down for selecting dates.
The problem I have is that IsPostBack always evaluates to False when the drop-down value changes (it is set to autopostback) or when the paging control is clicked.
The controls behave as if they do not function, even though they load the first time. When I select a date in the drop-down, a postback is done, the page refreshes, but nothing changes. This is because all my controls are binding to a default state, since the initial bind call is wrapped in an "If Not IsPostBack Then" wrapper, and since IsPostBack is always false, well, no happiness.
It does not actually seem to be a bug, since I can find no references to the issue anywhere, so I am assuming that it is a configuration/code issue with my site/code.
Can anyone please point me in the right direction? I am feeling my sanity slip between my fingers everytime I click on the drop-down and nothing happens.
As an interesting note, if I wrap my user control ascx code in a <form runat="server"> tag, the user control functions properly, but, of course, nothing else does, since this does create a nested <form> tag condition. It does tell me that there might be something wrong with the viewstate of the control though.
We have a nearly same problem, the auto postbacks and postbacks aren't fired correctly on Win7 with IE 9. Changing IE9 into compatibility mode resolves the problem. So we have set our intranet to force the compatibility mode.
Thanks for the reply. Unfortunately, compatibility mode does not help.
I cannot find any information on this anywhere. I sold using Umbraco to my boss, who sold its use to our clients, prepared demos and whatnot, and now I cannot get the user controls to work. Is it SharePoint time for me? Noooooo... Please help.
Can anyone give me a short (or even long) list of things that need to be in place for the .net viewstate and IsPostBack to function properly?
If you have a LinkButton control anywhere in the masterpage (or any content contained in the masterpage) OR you have any control that has the PostBackURL property set, the asp.net viewstate breaks. Then, IsPostBack will not work.
I went through all of my masterpage templates and all of my custom code, removed 3 PostBackURL assignments, and voila! It all works.
Thank you SO MUCH. I know this was over a year ago, but it's just helped me solve something that's been causing me problems for the past couple of days. That's the last thing I would have thought to look for, but stripping out any PostBackURL values in the user control does indeed make it work - I had an ASP.NET Repeater, and the ItemCommand function was never being called. Removing PostBackURL values makes the call go through.
Because that's how webforms work :) So it's not really an Umbraco issue but an issue related to webforms where the whole page is inside a server-side form, which makes it hard to work with multiple forms etc. etc.
.Net User Control; IsPostBack always False
Hello Gurus,
I have a 4.7.0 basic Runway site installed, and all I have chaged from the default is the inclusion of a couple of .Net user controls. The controls are fairly simple data grids, one with a paging control and another with a drop-down for selecting dates.
The problem I have is that IsPostBack always evaluates to False when the drop-down value changes (it is set to autopostback) or when the paging control is clicked.
The controls behave as if they do not function, even though they load the first time. When I select a date in the drop-down, a postback is done, the page refreshes, but nothing changes. This is because all my controls are binding to a default state, since the initial bind call is wrapped in an "If Not IsPostBack Then" wrapper, and since IsPostBack is always false, well, no happiness.
It does not actually seem to be a bug, since I can find no references to the issue anywhere, so I am assuming that it is a configuration/code issue with my site/code.
Can anyone please point me in the right direction? I am feeling my sanity slip between my fingers everytime I click on the drop-down and nothing happens.
As an interesting note, if I wrap my user control ascx code in a <form runat="server"> tag, the user control functions properly, but, of course, nothing else does, since this does create a nested <form> tag condition. It does tell me that there might be something wrong with the viewstate of the control though.
Thanks in advance,
Cesar
We have a nearly same problem, the auto postbacks and postbacks aren't fired correctly on Win7 with IE 9. Changing IE9 into compatibility mode resolves the problem. So we have set our intranet to force the compatibility mode.
hth, Thomas
Hi Thomas,
Thanks for the reply. Unfortunately, compatibility mode does not help.
I cannot find any information on this anywhere. I sold using Umbraco to my boss, who sold its use to our clients, prepared demos and whatnot, and now I cannot get the user controls to work. Is it SharePoint time for me? Noooooo... Please help.
Can anyone give me a short (or even long) list of things that need to be in place for the .net viewstate and IsPostBack to function properly?
Thanks,
Cesar
Hello Gurus,
I have solved the problem.
If you have a LinkButton control anywhere in the masterpage (or any content contained in the masterpage) OR you have any control that has the PostBackURL property set, the asp.net viewstate breaks. Then, IsPostBack will not work.
I went through all of my masterpage templates and all of my custom code, removed 3 PostBackURL assignments, and voila! It all works.
Thanks,
Cesar
Thank you SO MUCH. I know this was over a year ago, but it's just helped me solve something that's been causing me problems for the past couple of days. That's the last thing I would have thought to look for, but stripping out any PostBackURL values in the user control does indeed make it work - I had an ASP.NET Repeater, and the ItemCommand function was never being called. Removing PostBackURL values makes the call go through.
Who'd have thought it?!
Its no nearly 3 years later and this helped me solve my problem. MY workaround is a javascript that changes the "action" tag on the form.
How is that Umbraco has not fixed this problem?
Hi Yoni
Because that's how webforms work :) So it's not really an Umbraco issue but an issue related to webforms where the whole page is inside a server-side form, which makes it hard to work with multiple forms etc. etc.
So blame Microsoft ;-)
/Jan
is working on a reply...