简体   繁体   中英

ASP.NET 4.0: I cannot figure out how an UpdatePanel is updating an image control

I cannot figure out how an UpdatePanel is updating an image. There's an image rotation feature on the website's home page, and I'm trying to remove an image from that rotation — the image that the element starts with.

Here's the entirety of the code involved, as far as I can figure out:

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div style="text-align: left; padding-bottom: 5px;">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>   
        <asp:HiddenField ID="HiddenField_PanelID" runat="server" />
        <asp:Timer ID="Timer1" runat="server" Interval="18000" OnTick="Timer1_Tick">
        </asp:Timer>
        <div style="text-align: center; padding-bottom: 5px;">
            <asp:Image ID="ImageBanner" runat="server" />
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

It seems pretty much vanilla configuration. The Timer causes the postback. I can watch the HiddenField value get incremented, and the image's src subsequently update. But I can find nothing that references how this is happening! Is this some sort of default behavior on the part of these controls?

• There are literally no .cs files in the entire website.

• The pages are configured as CodeBehind; there are no inline scripts.

• I can't find any plugins or other scripts pertinent to this.

• There is jQuery and 1 "common.js" with no pertinent functions.

• Nothing on the Master page (since this content is contained entirely per page anyway).

• There are no App_* folders of any kind for this website. There is a bin folder, containing AjaxControlToolkit.dll and a custom www.[MySite].com.dll and .pdb (In there maybe? I don't know how to look or find out, beyond the object browser which seemed to basically show it containing the entire site structure as objects.)

• Web.Config has no clues; it's rather sparse and simple.

• The Properties panel shows nothing meaningful to me — no event handlers defined for the ScriptManager, UpdatePanel, Timer, HiddenField, or Image controls. Double-clicking in any respective empty field for an event or property auto-creates a function for that field and plops it onto the page (meaning it's not defined yet, correct?). The only places that seem helpful that I don't know I'm getting all the info from are listed as "Collection" and clicking on the "more"/ellipsis button inevitably brings up a dialog of all empty fields.

• I've searched the entire site for references to the UpdatePanel, HiddenField, and ImageBanner IDs. Nothing but the elements themselves.

• I can move the initial image (that I'm trying to remove from the rotation) out of its current folder, but that just breaks the link; the image control still tries to start with that same image.

• There is one preload function in the Header ContentPlaceHolder, but I can't see how it's related beyond the obvious (preloading the images):

<script type="javascript">
    function preload() {
        var i = 0;
        var imageObj = new Image();
        for (i = 1; i <= 32; i++) {
            //document.write('<img src="' + imageArray[i] + '" />'); // Write to page (uncomment to check images)
            imageObj.src = '/images/RoundedBanners/banner' + i + '.jpg';
        }
    }
    preload();
</script>

For my limited knowledge of VS Web Developer or of ASP.NET, I don't even know where else to look. Surely not in IIS or ASP's configuration somewhere...

Everything is edited from a different location, using subversion and source control; and then published out to the live site.

So, the www.[mysite].dll was the clue. I needed to know how that works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM