SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

Form fields Validation problem Options
ondrod
#1 Posted : Tuesday, March 11, 2008 12:37:34 PM
Rank: Newbie

Groups: Registered

Joined: 3/11/2008
Posts: 1
Hi,

I have a form with several fields and UploadManger control. I want to validate their content before starting to upload the selected file. Now I know that I can do it using JavaScript but I would prefer using ASP.NET valiadtion controls. The problem is that the form gets submited in order to validate and then I don't get to see progress bar. The code looks like this:

<form id="form1" name="form1" runat="server">


<!-- I want to validate this -->
<asp:TextBox ID="input1" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="rfv1" EnableClientScript="true" ControlToValidate="input1" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

<!-- This is UploadManager-->
    <kw:UploadManager  ID="uploadManager" runat="server" OnUploadComplete="uploadManager_UploadComplete" Width="100%" AutoUploadOnPostBack="false">
        <ProgressAreaTemplate>
            <table width="100%">
                <tr>
                    <td>
                        Uploading <kw:ProgressElement id="progressElement1" element="FileCountText" runat="server"></kw:ProgressElement>, <kw:ProgressElement id="progressElement7" element="ContentLengthText" runat="server"></kw:ProgressElement>.
                    </td>
                </tr>
                <tr>
                    <td>
                        Currently uploading: <kw:ProgressElement id="progressElement2" element="CurrentFileName" runat="server"></kw:ProgressElement>, file <kw:ProgressElement id="progressElement6" element="CurrentFileIndex" runat="server"></kw:ProgressElement> of <kw:ProgressElement id="progressElement5" element="FileCount" runat="server"></kw:ProgressElement>.
                    </td>
                </tr>
                <tr>
                    <td>
                        Speed: <kw:ProgressElement id="progressElement3" element="SpeedText" runat="server"></kw:ProgressElement>.
                    </td>
                </tr>
                <tr>
                    <td>
                        About <kw:ProgressElement id="progressElement4" element="TimeRemainingText" runat="server"></kw:ProgressElement>&nbsp;remaining.
                    </td>
                </tr>
                <tr>
                    <td>
                        <div style="border:1px solid #008800;height:1.5em">
                            <kw:ProgressBarElement  id="progressBarElement1" style="background-color:#00ee00;width:0;height:1.5em" runat="server">
                            </kw:ProgressBarElement>
                            <div style="text-align:center;position:relative;top:-1.35em">
                                <kw:ProgressElement id="progressElement8" element="PercentCompleteText" runat="server"></kw:ProgressElement>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>   
        </ProgressAreaTemplate>
    </kw:UploadManager>
   
  
<!-- This is the submit button, submits using JavaScript -->          
    <asp:Button ID="submitButton" runat="Server" Text="Upload" class="suSubmitButton" OnClientClick="SlickUpload_Submit();false;" />

</form>

Can someone help??? Thanks

Ondrej

ChrisHynes
#2 Posted : Tuesday, March 11, 2008 6:57:25 PM
Rank: Administration


Groups:

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ
If you want to use a validator to require a file to be selected, use the UploadManagerRequiredFileValidator control. Just drop it on your page and point the ControlToValidate property at the UploadManager control you're using.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.