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
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
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
|