Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...set current file for UrlControl in DetailsView edit modeset current file for UrlControl in DetailsView edit mode
Previous
 
Next
New Post
3/28/2008 12:35 PM
 

Hi,

I have a form for news.

I have a datagrid showing all news with select buttons, when it clicked, it open a detailsView with more detail.

In the database, my NewsTable has a field named File1, that contain the ID of a file (using the File table of DNN)

In the Insert mode of my DetailsView, I added the URLCONTROL, it works fine when I'm inserting and uploading new file.

But when I'm in EDIT mode, I want the 2 DropDownList (folder and file) to have their selected value to the fileID of the database... and it not working...

I don't know in wich event to put my code, and I'm not very sure how to acces the dropDownList...

Here is my code:

ASCX:

 <EditItemTemplate>
<dnn:url id="ul_file" runat="server" width="325" ShowUrls="False" ShowUpload="True" showfiles="True"  ShowTabs="False" ShowLog="False" ShowTrack="False" Required="False"  ></dnn:url>
<%#setDropList(DataBinder.Eval(Container.DataItem, "File1"))%>
</EditItemTemplate>

VB:

Function setDropList(ByVal iFileId As Integer) As String

            If (iFileId = -1) Then
                Return ""
            Else
                Dim objFileController As New FileController
                Dim objFileInfo As DotNetNuke.Services.FileSystem.FileInfo
                objFileInfo = objFileController.GetFileById(iFileId, PortalId)

                If Not objFileInfo.Folder = "" Then
                   'DirectCast(DetailsView.FindControl("ul_file").FindControl("cboFolders"), DropDownList).SelectedValue = objFileInfo.Folder 'Got an ERROR
                End If

                DirectCast(DetailsView.FindControl("ul_file").FindControl("cboFiles"), DropDownList).SelectedValue = iFileId 'This is working

            End If
            Return ""

End Function

 

I created the function setDropList because I didn't know in wich event to put my code...

Somebody knows the best way to do that?

 
New Post
12/8/2008 8:48 AM
 

Max-

Did you ever find a fix for this?  I'm in the same boat.  It worked on my development box, but not in production.  I tired to just set the URL property.  Not the case?

Thanks,

Jones

 
New Post
2/6/2009 11:51 AM
 

I had the same problem and couldn't find a solution anywhere online, so I went straight to the source...

It appears that, in the control's PreRender event handler, the file is only selected if the flag "_doReloadFiles" is set.  Setting the "FileFilter" property sets the flag.  Therefore, in order to get something like this to work:

this.UrlControl1.Url = "FileID=234";

I simply added another line of code:

this.UrlControl.FileFilter = this.UrlControl.FileFilter;
this.UrlControl1.Url = "FileID=234";

Of course this is just a hack to get it working, and not a vialbe long-term solution.  It was verified to work in version 04.09.01.

 
New Post
3/1/2009 3:31 PM
 

Wow.  Thank you!

This fixed it- and I had to make this change to my code, and I am upgraded to 4.9.1. So I guess it's not fixed yet.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...set current file for UrlControl in DetailsView edit modeset current file for UrlControl in DetailsView edit mode


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out