Welcome Guest Search | Active Topics | Sign In | Register

AjaxUploader Options
Boranet
Posted: Monday, June 16, 2008 8:48:22 AM
Rank: Advanced Member
Groups: Member

Joined: 7/25/2007
Posts: 34
Good Afternoon

I have put a textbox control on a EO ajaxControl, and on the FileUploaded Method i am trying to access the textbox, with the following code, but it doesn't recognize any value in it. What could be wrong?

Code: Visual Basic.NET
Protected Sub AJAXUploader1_FileUploaded(ByVal sender As Object, ByVal e As System.EventArgs) Handles AJAXUploader1.FileUploaded
        Dim upload As EO.Web.AJAXPostedFile
        For Each upload In AJAXUploader1.PostedFiles
            Dim value_text As TextBox = CType(AJAXUploader1.FindControl("mytitle"), TextBox)
            Dim x As String
            x = value_text.Text
        Next
End Sub
eo_support
Posted: Monday, June 16, 2008 9:03:50 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096
Hi,

I am not exactly sure what you mean by "dosn't recognize any value in it". We tried the following steps and it works fine:

1. Edit the uploader's LayoutTemplate to add a textbox with it's ID set to "mytitle";
2. Place the following code as yours into the uploader's FileUploaded event:

Dim value_text As TextBox = CType(AJAXUploader1.FindControl("mytitle"), TextBox)
Dim x As String
x = value_text.Text

We then enter some text and upload a file. x gets the correct value.

Can you try the same and see what you get? There is no need to place the code inside the for loop since you will only have one TextBox there.

Thanks





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.