PreRender on my User control not firing

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

In VS 2008, I have 2 pages, one aspx page and one ascx page.

The PreRender event is not firing on the Contol page.

The aspx page starts out:

<%@ Page Language="VB" AutoEventWireup="true" Trace="true"
CodeFile="TakeSurveyTest.aspx.vb" Inherits="TakeSurveyTest" %>
And the ascx page starts out:

<%@ Control Language="VB" AutoEventWireup="true"
CodeFile="TakeSurveyTest.ascx.vb" Inherits="TakeSurveyTest" %>

The PreRender code on my ascx page is:

Sub Page_PreRender(ByVal Sender As Object, ByVal E As EventArgs)
viewstate("TimeStart") = TimeStart
viewstate("ScreenRight") = ScreenRight
viewstate("ScreenWrong") = ScreenWrong
viewstate("LastTime") = LastTime
End Sub


The control works fine other than that.

What is missing?

Thanks,

Tom
 
But there lies the question.

If you set the control as visible=false and the PreRender event doesn't
fire - does the PageLoad event fire?

Also, I assume the IsPostBase is based on the page and not the control. But
if that is the case, how do you initialize the control.

I would normally do that in the "if not IsPostBack" code of my PageLoad
event. But will that happen when the control is not visible?

Thanks,

Tom
 
Back
Top