i have a very simple usercontorl i am trying to use in a page. It has a button and a gridview. On page load for the control i bind the gridview. see the code below:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim tree As New CMS.TreeEngine.TreeProvider
GridView1.DataSource = tree.SelectNodes("TEST", "/Events/%", "", True, "TEST.TestClass", "", "", -1)
GridView1.DataBind()
End If
End Sub
I am using this tag to place the user control in the page.
<cc1:CMSWebPartZone ID="zoneTopRight" runat="server" />
its the "Generic/user control" option when i add a web part to the page.
This works fine. However when I click the button to make a post back the gridview is not rendered. Basically the viewstate for the gridview dose NOT work. Is this a limitation of Kentico and is there a work around?
Also, if i use this same user control in regular page the gridview is displayed after the post back. So, i know it is not a problem with the user control.
I know i can place the user control in a regular page and then use an IFrame but i would very much like to avoid this.
This is pressing matter and any help i can get would be great.