Web User Control reference set to nothing when post back

J

Jie

Hi, All
I am use Web User Control for State/Province drop down list.

Public Class TEQContactCreate
Inherits TEQBasePage

Protected ddlProvinceFilter As ProvinceDropDownList

Protected ddlStateProvinceStep2 As ProvinceDropDownList

....

When the page loads, there is no problem. But when I click a button to do
the post back, ddlProvinceFilter is set to nothing, but
ddlStateProvinceStep2 is still not nothing. My page is pretty complicated.
There is 4 panels, ddlProvinceFilter is on the first panel and
ddlStateProvinceStep2 on the second panel. When I click NEXT button, first
panel is set the visible false and second panel's visible set to true. At
this time, ddlStateProvinceStep2 is also nothing.

I created a similar web project and there was no problem. Anyone knows why
it happens? Please help.

Thanks



Jie
 
J

JG

I found the problem is the outputCache on my web user control. When I
comment out this line of code, everything is OK. But I don't know why. I
would like to cache it.

<%@ OutputCache Duration="100" VaryByParam="none" %>
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top