Login  
Search All Forums
Dart Home | PowerWEB TextBox for ASP.NET | Custom Development Reply | PowerWEB TextBox for ASP.NET Topics | Forums   
AuthorForum: PowerWEB TextBox for ASP.NET
Topic: Image Select/Upload Failure
jjcraw

From: Atlanta, GA USA
Posts: 2
Member Since: 11/05/08
posted November 5, 2008 10:31 PM

Troublegetting this to work right. Facts:
1. Seems to work ok om my VS2008 test environment. Failure is on qa, Win 2003server
2. Creating HTMLBox dynamically
3. Here is picture of screen: http://screencast.com/t/Jg2gQmCD
4. When click Image Sel button get this:
http://screencast.com/t/cmgzf4WLa14
5. Here is code that dynamically adds text to a htmlcell:
 Public Overrides Function Control_Create(ByVal C As HtmlTableCell, ByVal pID As String) As WebControl
  Dim CE As New HtmlBox
  CE.ID = "ced" & pID
  CE.Height = New Unit(600)
  CE.UploadedFilesDirectory = "Upload"
  CE.UrlType = UrlType.Absolute
  C.Controls.Add(CE)

As you can see, File upload dialog box is pulling up the same page that is being edited. Must be something I have done wrong. But am stumped.
jjcraw

From: Atlanta, GA USA
Posts: 2
Member Since: 11/05/08
posted November 12, 2008 11:49 AM

Turns out there the problem is a bug that occurs when the htmlbox is created in a postback. Ken Drake supplied the following work around:

If (IsPostBack Or ((Request("pwuploadid") <> Nothing) And (Request("pwuploadid") <> ""))) Then
Dim tbxTest As New HtmlBox
tbxTest.UploadedFilesDirectory = "UpLoad"
tbxTest.UrlType = UrlType.Absolute
tbxTest.ID = "tbxTest"
Me.Controls.Add(tbxTest)
End If

My conclusion is that if the FileUpload dialog is executed, there is a call to the server to your page and the htmlbox must be recreated in this call.
Reply | PowerWEB TextBox for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX