473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

UserControl, OutputCache and AutoPostback problem

I am building an ASP.NET application and have just encountered something very
strange which I would like explained if possible.

In BaseForm.ascx I have the following <form> element:

<form ID="formBaseForm" method="post" runat="server">
<!-- Banner UserControl -->
<PW:Banner runat="server" ID="Banner1" />

<!-- Initial UserControl -->
<PW:Initial runat="server" ID="Initial1" />

<!-- Content Section -->
<table border="1" width="95%" cellpadding="2" cellspacing="0">
<tr>
<td>
<!-- content goes here -->
<asp:PlaceHolder id="_placeHolder" runat="server" />
</td>
</tr>
</table>
</form>

The unexpected behaviour occurs in the Initial UserControl where I have a
similar table to the one above with four DropDownLists, two of which have
AutoPostBack set to True.

When I do a GET request to an .aspx page that Inherits from BaseForm (and
thus renders the UserControl) and do View | Source, I can see a <SCRIPT>
block in the <body> with the expected __dopostback function, I can also see
the onchange events on the two <select> tags wired up to __dopostback.

When I select another value in one of the DropDownLists where AutoPostback
is True, thus invoking onchange which calls the __dopostback, something
happens which looks like a postback but I don't think is because a breakpoint
in my page_load is not hit. When I do View | Source, I see the <selects>
onchange is still pointing to __dopostback but the entire <SCRIPT> block does
not appear anywhere. When I select another value in one of the DropDownLists
now, I get a JavaScript error "Object expected" because obviously there is
now no __dopostback function.

This only happens when I have the following at the top of Initial.ascx:

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

The trouble is I haven't the faintest idea why...

Cheers,

Pete

Nov 22 '05 #1
0 1090

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Pete | last post by:
I am building an ASP.NET application and have just encountered something very strange which I would like explained if possible. In BaseForm.ascx I have the following <form> element: <form...
3
by: marshal | last post by:
Hi to All, I am using <% @ OutputCache Duration="60" VaryByParam="none" %> in my usercontrol say "myControl.ascx". This user control has a property say "title". Now am Dynamically Loading...
9
by: Peter | last post by:
I have an Usercontrol on a WebForm, on this Usercontrol is a button, I want to save data that's residing on the WebForm when user clicks on the button that's on the UserControl. How do I call a...
8
by: Raed Sawalha | last post by:
Hi, I have a strange problem with a usercontrol on a page. The usercontrol dispalyes three categories (From a database) when the user clicks a category they see all the products in a shop for...
4
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three...
0
by: N. Demos | last post by:
Hello, I have a custom usercontrol, of which I have two instances of in my aspx page. Both the usercontrol and page have codebehind. In the page codebehind, I want a member variable for each...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
6
by: Rolf Welskes | last post by:
Hello, I want to partial cache by using a UserControl. Now I have a file dependency. In msdn I see it is not possible to do it the same way as in a page. The only information is to create a...
1
by: ABCL | last post by:
Hi All I have usercontrol on the page that I have added at design Time and cached it How can I remove the cached Usercontrol from outputcache. I want to remove cached version in session start...
1
by: ABCL | last post by:
Hi all Can any one tell me if I want to cache the User control, Where does it cached? I am not able to it in "Cache" object Thanks
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.