This is a migrated thread and some comments may be shown as answers.

Getting credentials prompt when trying to upload file

3 Answers 209 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 27 Oct 2011, 03:15 PM
Hello,

I am using Rad Ajax controls version 2011.2.915. Whenever a user running Windows XP and IE 7 tries to upload a file from My Documents or another network location they get prompted with a windows credential box. If they enter their credentials IE 7 locks up.

The RadAsyncUpload works fine in windows 7 IE8. If the IE 7 users try a file from their C drive, that functions correctly as well. 

I have tried to allow Anonymous Access to the website in IIS (5) but this does not make a difference. Placing these lines of Javascript before the upload control also do not help.

 <script type="text/javascript">     
   if (Telerik.Web.UI.RadAsyncUpload != null && Telerik.Web.UI.RadAsyncUpload.Modules != null) {
         Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function() { return false; };
         Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function() { return false; };
   }
</script>



How do I either disable the flash and silverlight, or how do I fix the permissions problem?

Here is how I am using the uploader in a RadGrid, once as an attachment column for inserting, and once as a control in a template column for editing.

<telerik:GridAttachmentColumn AttachmentDataField="Data" FileName="Name"
                       FileNameTextField="Name"
                       HeaderText="View Attachment" UniqueName="Data" DataTextField="Name"
                       AttachmentKeyFields="FormSequenceNr" EditFormHeaderTextFormat="">
                   </telerik:GridAttachmentColumn>
                   <telerik:GridTemplateColumn HeaderText="File"  DataField="Name" FilterControlAltText="Filter TemplateColumn column"
                       UniqueName="Name">
                       <ItemTemplate>
                           <asp:Label runat="server" ID="lblName" Text='<%# Eval("Name") %>' />                         
                       </ItemTemplate>                           
                       <EditItemTemplate>                       
                           <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" OnClientFileUploaded="OnClientFileUploaded"
                               OnValidatingFile="RadAsyncUpload1_ValidatingFile">
                           </telerik:RadAsyncUpload>
                       </EditItemTemplate>
                   </telerik:GridTemplateColumn>




Thanks

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Oct 2011, 06:07 AM
Hello Justin,

Please take a look into the following forum post which explains the same.
SOLUTION: Upload fails OR Login prompt appears when using Forms / Windows Authentication.

Hope it helps.

Thanks,
Princy.
0
Justin
Top achievements
Rank 1
answered on 31 Oct 2011, 12:43 PM
I have tried both of those tips. When enabling annoymous access and then allowing the web resource, I include the location piece in my web.config and it says that it cannot find the web resource and won't use the location piece that I have added.

When I try to add the javascript that also does not work. I suspect it is because I am not placing it correctly. I have both an edit template and an attachment column that use the RadAsyncUpload, so I was placing the javascript above the RadGrid that has both of those columns. If that is not the correct placement then where in the following code block should the javascript go?

<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" AutoGenerateColumns="False"
            Width="97%" ShowStatusBar="True" OnItemCreated="RadGrid1_ItemCreated" OnInsertCommand="RadGrid1_InsertCommand"
            OnNeedDataSource="RadGrid1_NeedDataSource" OnDeleteCommand="RadGrid1_DeleteCommand"
            OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCommand="RadGrid1_ItemCommand"
            OnPreRender="RadGrid1_PreRender" OnItemDataBound="RadGrid1_ItemDataBound">
            <ValidationSettings EnableModelValidation="False" EnableValidation="False" />
            <ClientSettings>
                <ClientEvents OnCommand="gridCommand" />
            </ClientSettings>
            <ValidationSettings EnableValidation="False" EnableModelValidation="False"></ValidationSettings>
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
                <Selecting AllowRowSelect="True"></Selecting>
                <ClientEvents OnCommand="gridCommand"></ClientEvents>
            </ClientSettings>
            <MasterTableView CommandItemDisplay="Top" DataKeyNames="FormSequenceNr">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit Attachment">
                        <HeaderStyle Width="3%" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridAttachmentColumn AttachmentDataField="Data" FileName="Name" FileNameTextField="Name"
                        HeaderText="View Attachment" UniqueName="Data" DataTextField="Name" AttachmentKeyFields="FormSequenceNr"
                        EditFormHeaderTextFormat="">
                    </telerik:GridAttachmentColumn>
                    <telerik:GridTemplateColumn HeaderText="File" DataField="Name" FilterControlAltText="Filter TemplateColumn column"
                        UniqueName="Name">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblName" Text='<%# Eval("Name") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" OnClientFileUploaded="OnClientFileUploaded"
                                OnValidatingFile="RadAsyncUpload1_ValidatingFile">
                            </telerik:RadAsyncUpload>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="AuditUser" FilterControlAltText="Audit User"
                        HeaderText="Last Updated User" UniqueName="AuditUser">
                        <EditItemTemplate>
                            <asp:Label ID="AuditUserLabel" runat="server" Text='<%# Eval("AuditUser") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="AuditUserLabel" runat="server" Text='<%# Eval("AuditUser") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="AuditTime" FilterControlAltText="Audit Timestamp"
                        HeaderText="Last Updated Date" UniqueName="AuditTime">
                        <EditItemTemplate>
                            <asp:Label ID="AuditTimeLabel" runat="server" Text='<%# Eval("AuditTime") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="AuditTimeLabel" runat="server" Text='<%# Eval("AuditTime") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton"
                        FilterControlAltText="Filter column1 column" UniqueName="Delete" HeaderText="Delete Attachment">
                        <HeaderStyle Width="2%" />
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>
0
Peter Filipov
Telerik team
answered on 01 Nov 2011, 12:42 PM
Hi Justin,

Please register from the server side, when the edit button is clicked, the javascript code which disables Silverlight and Flash plugins.

In case that you are using the latest version of our controls (Q3 2011 BETA) the DisablePlugins property is available and you can set it to true instead of registering javascript code from code-behind.

Best wishes,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
AsyncUpload
Asked by
Justin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Justin
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or