c# - page theme causing "Failed to load viewstate." error -


in web.config have following:

<pages theme="mytheme" enablesessionstate="true" validaterequest="false"  enableeventvalidation="false" viewstateencryptionmode="never"  enableviewstatemac="false"> 

as added theme property instantly started receive:

failed load viewstate. control tree viewstate being loaded must match control tree used save viewstate during previous request.for example, when adding controls dynamically, controls added during post-back must match type , position of controls added during initial request.

when remove theme, no longer viewstate errors. can offer inside happening or how fix it?

thanks.

fixed by:

  1. adding runat="server" , id attributes link (stylesheet)
  2. calling page.header.findcontrol("link").databind() in page_load method of master page.

do not call page.header.databind(); since databind entire header.


Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -