COntrol does not post back on specific pages

Jan 6, 2009 at 12:53 AM
Created the a control based on the samples in these forums. Everything worked great in my sample apps. When I ported it to web site. It appears to only post once when I click on before I click on browse. After making a file selection it does not post back. Hense it simple redirects me a a frame to the home page. I have put hte same code on other pages and it works. Has anyone run into a problem like this:


Here is the partial code:

client side:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HPSDTicketFileUploadControl.ascx.cs" Inherits="UserControls_HPSDTicketFileUploadControl" %>
<%@ Register Assembly="FUA" Namespace="Subgurim.Controles" TagPrefix="cc1" %>

 <table width="100%">  
    <tr>
        <td >
           <asp:Label ID="lblFileName" runat="server" Text="File Upload"></asp:Label>
        </td>
       <td width="90%"> 
            <cc1:FileUploaderAJAX ID="FileUploaderAJAX1" runat="server" MaxFiles="5"  showDeletedFilesOnPostBack="false"
               File_RenameIfAlreadyExists="false" text_Uploading="Uploading" Style="border" 
                /> 
            <div id="info" style="overflow:auto; font-family: Arial, Verdana, Tahoma;"></div>
        </td>
    </tr>
 
</table>


serverside:
using Subgurim.Controles;


public partial class UserControls_HPSDTicketFileUploadControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

        FileUploaderAJAX1.text_Add = "add Another File";
        FileUploaderAJAX1.text_Delete = "[Remove]";
        FileUploaderAJAX1.text_Uploading = "File Uploading Please wait";
        FileUploaderAJAX1.text_X = "[Remove]";


        FileUploaderAJAX1.CssClass = "";
        FileUploaderAJAX1.Style = @"
                body{font-size: smaller; color: red;}
                a{font-weight:bold;}";

        if (FileUploaderAJAX1.IsPosting)
            this.managePost1(); 
    }

    private void managePost1()
    {
        try
        {
            HttpPostedFileAJAX pf = FileUploaderAJAX1.PostedFile;

            //if (pf.ContentType.Equals("image/gif") && pf.ContentLength <= 5 * 1024)
                FileUploaderAJAX1.SaveAs("~/temp", pf.FileName);

            FileUploaderAJAX1.PostedFile.responseMessage_Uploaded_NotSaved = "<span style=\"font-family: arial; font-size: 12px;\">Sorry, there was a problem uploading this file.</span>";
        }
        catch (System.Exception ex)
        {
            Response.Write(ex.Message.ToString());
     
Jan 6, 2009 at 5:29 PM
alright! I will answer my own question. Since I had created a control. I had placed on a page that had a page redirect in its page_load event. Hence my iframe kept being redirected. The fix was that I had to check for request variables that were used by the control.

Thanks