IsPostBack is not reliable in either a SiteModuleControl or System.Web.UI.UserControl

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/10/2009 1:56:02 PM
Gravatar
Total Posts 8

IsPostBack is not reliable in either a SiteModuleControl or System.Web.UI.UserControl

Hello,

I have a DropDownList with AutoPostBack=true.  Upon selecting a drop down item, I redirect the user to another page which also hosts the control.  When the control is displayed, the IsPostBack value is false every time.

Any ideas?

Bill

4/10/2009 2:01:30 PM
Gravatar
Total Posts 8

Re: IsPostBack is not reliable in either a SiteModuleControl or System.Web.UI.UserControl

Well, rather than deleting this post...  I'll leave it here for the benefit of the community.

The Web.config explains this in very good detail --- nice, Joe!

<!--
Disabling viewstate at the page level can reduce the size of the page
which improves performance. Modules that do postback usually need
ViewState Enabled so in the Page_Load event of modules that postback
I add a line of code like this
Page.EnableViewState = true;
This works fine for all the built in modules but I've had at least one
developer tell me it did not work for his custom modules so I added this
setting here which you can set to false if you find it breaks any functionality
in your custom modules. If it doesn't break anything I recommend leaving this
set to true
-->
<add key="DisablePageViewStateByDefault" value="false" />

Setting the view state in the module does the trick!

You must sign in to post in the forums. This thread is closed to new posts.