Welcome to Dream.In.Code
Become an Expert!

Join 150,045 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,665 people online right now. Registration is fast and FREE... Join Now!




Fille Upload control issue

 
Reply to this topicStart new topic

Fille Upload control issue, FileUpload control not posting to server within WizardControl in an AJ

Sonic88
19 Feb, 2008 - 02:52 PM
Post #1

D.I.C Head
**

Joined: 19 Feb, 2008
Posts: 166



Thanked: 2 times
My Contributions
Hello Everyone. Long time reader, first time poster haha. Anyways, Ive been working on this weird issue concerning a fileupload control that is within a wizard control step and then all this is within an AJAX update panel. Ive searched and searched on the internet and I know the problem is that the file upload control wont work unless you do a full postback. Now, everything I have found has said to use a trigger within the update panel for the the control you wish to cause the postback. This works fine if the fileupload is just within the update panel and not the wizard, but within the wizard i can not seem to get the submit button (which uploads the file etc.) to trigger the full postback. Has anyone else had this issue? I have found a few people with the same problem online but no solutions as of yet.

Any help is greatly appreciated. Right now as a temp fix I have set the trigger control to the wizard control itself, but this basically defeats the whole purpose of the update panel as the full postback is triggered for every event of the Wizard control and I lose the nice pretty "no-flicker" effect of the ajax panel.

I would post some code but it is on my system at work, so for now I was just seeing if anyone has encountered this or found a suitable workaround.

Thanks alot.

This post has been edited by Sonic88: 19 Feb, 2008 - 02:54 PM
User is offlineProfile CardPM
+Quote Post

Sonic88
RE: Fille Upload Control Issue
20 Feb, 2008 - 06:06 AM
Post #2

D.I.C Head
**

Joined: 19 Feb, 2008
Posts: 166



Thanked: 2 times
My Contributions
OK well back at work and i thought id post a little code that may illustrate my issue more. I have left out some wizard steps as it is a very large wizard and will just give the needed arts.

CODE

            
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers>
                <asp:PostBackTrigger ControlID="btnSubmitImage" />
            </Triggers>
            <ContentTemplate>
            
            <asp:Wizard ID="Wizard1" runat="server" BackColor="#E6E2D8" Font-Names="Verdana" Font-Size="0.8em" Width="800px" ActiveStepIndex="5" OnActiveStepChanged="Wizard1_ActiveStepChanged">
                <WizardSteps>
<!--other wizard steps here-->
                    <asp:WizardStep runat="server" Title="Store Image">
                    <span class="subHeadingGrn">Store Image<br />
                    </span>
                        <br />
                        <table>
                            <tr>
                                <td class="topAlignCenter" colspan="2" style="height: 15px">
                                    Current Store Image<br />
                                    <asp:Image ID="imgStoreImage" runat="server" BorderColor="Black" BorderStyle="Solid"
                                        BorderWidth="1px" />
                                </td>
                            </tr>
                            <tr>
                                <td class="topAlignLeft" colspan="2">
                                    To replace this image, select the image from your computer in the form below and<br />
                                    click the submit button.</td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:FileUpload ID="fuStoreImage" runat="server" />
                                    <asp:Button id = "btnSubmitImage" runat="server" CssClass="btnRed" Text="Submit" OnClientClick="return confirm('Are you sure you want to replace the current image?');" OnClick="btnSubmitImage_Click"/>
                                </td>
                            </tr>
                        </table>
                        <asp:Label ID="lblImgMsg" runat="server"></asp:Label>
                        <br />
                    
                    </asp:WizardStep>
                </WizardSteps>
                
                
                <StepStyle BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderStyle="Solid" BorderWidth="2px"
                    CssClass="contentCell" Width="680px"/>
                <SideBarStyle CssClass="leftNav" />
                <NavigationStyle CssClass="nav" Height="10px"/>
                <NavigationButtonStyle CssClass="btnRed" />
                <SideBarButtonStyle CssClass="noLineWhite"/>
                </asp:Wizard>
            </ContentTemplate>
            </asp:UpdatePanel>


Note the trigger declaration at the beggining of the update panal. I need this trigger to fire when the btnSubmitImage button of the wizard step is clicked so that the full postback is only triggered when a file uploaded and not on every step. I hope this clarifies things and any help is greatly appreciated as this project is at its deadline and I really want that nice AJAX update panel effect. Otherwise Ill have to leave as is for now. Being a client utility and not public app it would be acceptable but my OCD wont allow me to let go of the AJAX lol
User is offlineProfile CardPM
+Quote Post

Sonic88
RE: Fille Upload Control Issue
21 Feb, 2008 - 02:52 PM
Post #3

D.I.C Head
**

Joined: 19 Feb, 2008
Posts: 166



Thanked: 2 times
My Contributions
Cmon I know someone has at least encountered this issue in some form or another? I know im new but this has been driving me crazy. Anyone? Someone?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:06PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month