Response.Redirect not working

Sep 4, 2009 at 1:23 PM

why Response.Redirect not working in FileReceived event?


protected void Page_Load(object sender, EventArgs e)
    {
        FileUploader1.FileReceived += new EventHandler<com.flajaxian.FileReceivedEventArgs>(FileUploader1_FileReceived);
    }

    void FileUploader1_FileReceived(object sender, com.flajaxian.FileReceivedEventArgs e)
    {
        System.Diagnostics.Debug.WriteLine("Uploaded: " + e.File.FileName);

        if (e.isLast)
        {
            Response.Redirect("Default.aspx");
        }
    }

 

 

 

protected void Page_Load(object sender, EventArgs e)
    {
        FileUploader1.FileReceived += new EventHandler<com.flajaxian.FileReceivedEventArgs>(FileUploader1_FileReceived);
    }
    void FileUploader1_FileReceived(object sender, com.flajaxian.FileReceivedEventArgs e)
    {
        System.Diagnostics.Debug.WriteLine("Uploaded: " + e.File.FileName);
        if (e.isLast)
        {
            Response.Redirect("Default.aspx");
        }
    }

 

 

Coordinator
Sep 4, 2009 at 4:17 PM

Interesting how do you expect it to work if the code is executed in a separate ajax request?

Did you look at the docs? http://flajaxian.com/flajaxian.com/FileUploader2.0Help.html#HowToUseClientSideEvents

Sep 5, 2009 at 12:39 AM

if you didn't noticed, the code above are in Server Side.

Coordinator
Sep 5, 2009 at 1:04 AM

That's exactly your problem. 

A piece of advice from me. Download this program http://www.fiddlertool.com/Fiddler2/version.asp and try to understand how the requests work. Use the control and look at the requests. Spend some time understanding web development process and believe me later on it will pay off.

Sep 5, 2009 at 1:06 AM

never mind. got it working