ASP.net pass params to an assembly

Fetcas
Fetcas used Ask the Experts™
on
I have registered the following assembly in ASP.net:-

<%@ Register Assembly="FlashUpload" Namespace="FlashUpload" TagPrefix="FlashUpload"  %>

and in the HTML I have:-

<FlashUpload:FlashUpload ID="flashUpload" runat="server"
         UploadPage="Upload2.axd"   QueryParameters="folder=tmp33"
          OnUploadComplete="UploadComplete()"
           FileTypeDescription="Images" FileTypes="*.gif; *.png; *.jpg; *.jpeg"
           UploadFileSizeLimit="1800000" TotalUploadSizeLimit="2097152" />

This invokes the above assembly and it all works fine.  What I want to do is pass a parameter into the above invocation of FlashUpload in the QueryParameters element (instead of just the above flat "folder=tmp33").  I have tried <%# name_of_param %> and various other combinations but cant get it to take a param.

Any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
jorge_torizResearch & Development Manager

Commented:
Declare a public property in you control and then store the value inside ViewState

Author

Commented:
I have setup a public property as follows:-

public string uploadFolder
{
    get
    {
        string text = (string)ViewState["uploadFolder"];
        if (text != null)
            return text;
        else
            return string.Empty;
    }
    set
    {
        ViewState["uploadFolder"] = value;
    }
}

And I have used the following in the html:-

<FlashUpload:FlashUpload ID="flashUpload" runat="server"
         UploadPage="Upload2.axd"   QueryParameters='folder=<%# uploadFolder %>'
          OnUploadComplete="UploadComplete()"
           FileTypeDescription="Images" FileTypes="*.gif; *.png; *.jpg; *.jpeg"
           UploadFileSizeLimit="1800000" TotalUploadSizeLimit="2097152" />

But when i look at the html which arrives at the client browser it literally has the name of the property 'uploadFolder' rather than the property's content.  It is like the <% %> is not being opened up and processed.

Author

Commented:
One other thing.  If I move the  <%# uploadFolder %> out of the <FlashUpload: ... /> object, it gets expanded correctly to deposit the content of the uploadFolder property onto the page.  
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

jorge_torizResearch & Development Manager

Commented:
If you call Page.DataBind?

Author

Commented:
Where would I call Page.DataBind?  in the Page_Load handler?
Commented:
I have solved this myself.  

I found that I could modify the properties of the flashupload object in code directly from the Load_Page event handler.  No need to try to feed literal strings to the Initializer using the <%= ... %> syntax.

Thanks Anyway,

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial