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

Validation with SlickUpload control Options
ayazaslam
#1 Posted : Tuesday, October 06, 2009 12:34:27 AM
Rank: Newbie

Groups: Registered

Joined: 9/27/2009
Posts: 5
Location: Pakistan

Dear support,

I am using SlickUpload control on a page where there are other validators (in seperate validation groups). The problem I am facing is that on postback SlickUpload control causes all validators to fire and the page doesn't get posted back. Is there a way to associate SlickUpload with a particular validation group or stop it from causing validation altogether?

Regards,

Ayaz

Axosoft
#2 Posted : Tuesday, October 06, 2009 10:42:12 AM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

SlickUpload triggers the validation on the page by default to ensure that it is valid to start an upload. If you don't want to trigger validation, you can turn off the auto upload trigger and start the upload using javascript. To do this:

 - Set the AutoUploadOnPostBack="false" attribute on the SlickUpload control.
 - Add a function to trigger the upload (replace SlickUpload1 with the ID of your SlickUpload control)

function startUpload()
{
    kw.get("<%=SlickUpload1.ClientID%>").submit();
}

Then call the function from the onclick event of the upload button. If you're using OnClientClick, you'll need add return false at the end to keep ASP.NET from overriding the upload:

OnClientClick="startUpload();return false;"

dougdomeny
#3 Posted : Tuesday, October 11, 2011 10:57:33 AM
Rank: Newbie


Groups: Registered

Joined: 10/11/2011
Posts: 4
Location: Manchester, NH, USA
The page validation still occurs when submit() is called and AutoUploadOnPostBack="false". Debugging into the submit method code shows:

this.submit=function(f,g) {
if(f!=false)
{
if(window.Page_ClientValidate)if(Page_ClientValidate()==false)return false;
if(callHandlers(beforeHandlers)==false)return false
}
...

The Page_ClientValidate call should be Page_ClientValidate("") to avoid validation all validation groups on the page. As a workaround, call

slickUpload.submit(false)

SlickUpload version 5.5.11
ASP.NET 4.0
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.