I would like to use the file selector dialog demo to store the file path in a databound text box in a formview.
My current code looks like this. How can I change it to store the path in my databound file location textbox?
Thanks
Brett
My current code looks like this. How can I change it to store the path in my databound file location textbox?
| <asp:FormView ID="fvAddBidDoc" runat="server" DataKeyNames="id" DataSourceID="dsAddBidDoc" | |
| DefaultMode="Insert"> | |
| <InsertItemTemplate> | |
| <table class="style1"> | |
| <tr> | |
| <td> | |
| Document Number:</td> | |
| <td> | |
| <asp:TextBox ID="DocumentNumberTextBox" runat="server" | |
| Text='<%# Bind("DocumentNumber") %>' /> | |
| </td> | |
| <td> | |
| Document Name:</td> | |
| <td> | |
| <asp:TextBox ID="DocumentNameTextBox" runat="server" | |
| Text='<%# Bind("DocumentName") %>' /> | |
| </td> | |
| </tr> | |
| <tr> | |
| <td> | |
| Posting Date: | |
| <%--<asp:TextBox ID="PostingDateTextBox" runat="server" Text='<%# Bind("PostingDate") %>' />--%></td> | |
| <td> | |
| <telerik:RadDatePicker ID="PostingDateTextBox" Runat="server" | |
| DbSelectedDate='<%# Bind("PostingDate") %>' Skin="Hay"> | |
| <Calendar Skin="Hay" UseColumnHeadersAsSelectors="False" | |
| UseRowHeadersAsSelectors="False" ViewSelectorText="x"> | |
| </Calendar> | |
| <DatePopupButton HoverImageUrl="" ImageUrl="" /> | |
| </telerik:RadDatePicker> | |
| </td> | |
| <td> | |
| Closing Date: | |
| </td> | |
| <td> | |
| <telerik:RadDatePicker ID="ClosingDateTextBox" Runat="server" | |
| DbSelectedDate='<%# Bind("ClosingDate") %>' Skin="Hay"> | |
| <Calendar Skin="Hay" UseColumnHeadersAsSelectors="False" | |
| UseRowHeadersAsSelectors="False" ViewSelectorText="x"> | |
| </Calendar> | |
| <DatePopupButton HoverImageUrl="" ImageUrl="" /> | |
| </telerik:RadDatePicker> | |
| </td> | |
| </tr> | |
| <tr> | |
| <td> | |
| File Location:</td> | |
| <td> | |
| <asp:TextBox ID="FileLocationTextBox" runat="server" | |
| Text='<%# Bind("FileLocation") %>' /> | |
| </td> | |
| <td> | |
| Select a file: | |
| </td> | |
| <td> | |
| <input ID="fileName" size="50" /><input | |
| onclick="OpenFileExplorerDialog(); return false;" type="button" | |
| value="Open ..." /><br /> | |
| Open the dialog and double click on a file to select it. | |
| <script type="text/javascript"> | |
| function OpenFileExplorerDialog() { | |
| var wnd = $find('<%=fvAddBidDoc.FindControl("ExplorerWindow").ClientID %>'); | |
| wnd.show(); | |
| } | |
| //This function is called from the Explorer.aspx page | |
| function OnFileSelected(wnd, fileSelected) { | |
| var textbox = $get("fileName"); | |
| textbox.value = fileSelected; | |
| } | |
| </script> | |
| </td> | |
| </tr> | |
| <tr> | |
| <td> | |
| <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" | |
| CommandName="Insert" Text="Insert" /> | |
| </td> | |
| <td> | |
| <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" | |
| CommandName="Cancel" Text="Cancel" /> | |
| </td> | |
| <td> | |
| </td> | |
| <td> | |
| </td> | |
| </tr> | |
| </table> | |
| <br /> | |
| <telerik:RadWindow runat="server" Width="530px" Height="550px" VisibleStatusbar="false" | |
| NavigateUrl="~/bidding/secure/explorer.aspx" ID="ExplorerWindow" Modal="true" | |
| Behaviors="Close,Move"> | |
| </telerik:RadWindow> | |
| | |
| </InsertItemTemplate> | |
| </asp:FormView> |
Thanks
Brett
