PreRender on my User control not firing

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
 
T

tshad

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top