Telerik Forums
Kendo UI for jQuery Forum
1 answer
1.1K+ views

I am using a Kendo upload to save files to my server. However, I would like to send the files to a C# web method in a web service where I then perform the code that saves the files to the server.

I am having difficulty when trying to call my web method.

Here is what I have:

  [WebMethod]
        //Saves attachment files to server
        public string UploadAttachments(IEnumerable<HttpPostedFileBase> files)
        {
            string returnMessage = "Copying Attachments...";
            try
            {
                  // The Name of the Upload component is "files"
            if (files != null)
            {
                foreach (var file in files)
                {
                    // Some browsers send file names with full path.
                    // We are only interested in the file name.
                    var fileName = Path.GetFileName(file.FileName);
                    var physicalPath = Path.Combine(Server.MapPath("~/App_Data/Attachments"), fileName);
                    file.SaveAs(physicalPath);
                }
            }
        }
          
            catch (Exception e)
            {
                returnMessage = "Fail";
            }

            return returnMessage;

        } //End

 

Here is the upload input on my webpage and the javascript I am using:

   <h2>Attachments:</h2>
<input id="files" type="file" name="files" />

 <script>
        //when adding attachments
        $(document).ready(function () {
            $("#files").kendoUpload({
                async: {
                    saveUrl: "../WebService.asmx/UploadAttachments",
                    removeUrl: "remove",
                    multiple: true,
                    autoUpload: true
                }
            });
        });
    </script>

 

I cannot get it to call my method when trying to pass the "IEnumerable<HttpPostedFileBase> files" , but it will hit the method if I take that part out, but then I cannot perform the rest of the code within the method.

Currently, when I try to upload a file, it automatically says it has failed and never calls my web method.

Am I missing a step somewhere?

 

Boyan Dimitrov
Telerik team
 answered on 22 Jun 2015
1 answer
162 views

Hi All,

I started my journey with Kendo MVVM today and immediately I faced this problem. I have view contains div with nested divs. It looks like:

<div id="splitter" class="vsm-splitter" data-role="splitter" data-panes="[
            { collapsible: true, min: '640px', size: '50%', scrollable: false },
            { collapsible: false, min: '300px' },
            { collapsible: true, min: '320px', size: '25%' }]"
    data-bind="visible: isVisible">
    <div>
        @Html.Partial("widget1")
    </div>
    <div>
        @Html.Partial("widget2")
    </div>
    <div>
        @Html.Partial("widget3")
    </div>
</div>

Parent div should be bound to splitter and children divs to widgets. We want to have view model for splitter which is very simple:

var vm = kendo.observable({ isVisible: true });

and have separated view model for each component and bind them one by one. So code can look like that:

kendo.bind($('#splitter'), vm);
kendo.bind($('#widget1Root'), vmW1);
kendo.bind($('#widget2Root'), vmW2);
kendo.bind($('#widget3Root'), vmW3);

but it causes following error:

Uncaught TypeError: undefined has no properties

When I replace Partial with static text it works ok. Do you know how I can proceed with that kind of issue? Any suggestion?

Best Regards,
Mateusz

Daniel
Telerik team
 answered on 22 Jun 2015
2 answers
349 views

We are using a ScrollView bound to a local data source that is configured to show multiple items per page.  I ran into an issue today where it looked like the ScrollView was not refreshing its contents after an item in the data source had been updated via .set().  However, I discovered purely by accident that if you scroll two pages to the right and then scroll back two pages to the left, the ScrollView will have magically picked up your changes and re-rendered the items.  I've put together a Fiddle that demonstrates this behavior:

http://jsfiddle.net/rmaezowx/

If you push the "Make Yellow" button, nothing seems to happen even though the data source has been properly updated.  If you then swipe from the right twice, and then to the left, you will see what I'm talking about.  This looks like a bug in the ScrollView, is there any other workaround besides re-setting the data source (I haven't tried this yet)? 

 

Artie
Top achievements
Rank 1
 answered on 22 Jun 2015
11 answers
201 views
I'm wondering anyone has any ideas on what the best way or a good way of implementing some kind of automatic scrolling when a list of items exceeds the container's dimensions and displays scroll bars?
Petyo
Telerik team
 answered on 22 Jun 2015
1 answer
311 views

You can see this but in your own demo: http://demos.telerik.com/kendo-ui/datepicker/index

In the first DateTimePicker, for "Show e-mails from:" enter the following for the date: 

12/31/20000003

Now, tab out of the DateTimePicker box. It re-formats the date to "12/31/2000" which, in my opinion, is great.

However, if you enter this date, it doesn't have the same behavior:

12/31/21000003

We are seeing this same behavior in our use of the control, and would like it to behave consistently. Any advice on how to get that to work?

 

 

Plamen Lazarov
Telerik team
 answered on 22 Jun 2015
2 answers
298 views
Hi everybody, I hope someone can help me. I post this question here because I think that the main problem is more ListView-related (actually, the behaviour is the same in the Kendo Grid too), while the Drag&Drop-operation itself works. However ...

I got a ListView (or Grid, same problem there) with selectable set to "multiple". What I need to do is to select one or more items from the ListView and then drag then over to a different area. The dragging works, however when I start dragging the items, the mouse draws kind of a "rubberband" on the screen thus changing the selection in the ListView when I drop the items on the target. I think it has something to do with the multiselect-feature, since everything works fine when selectable is set to "single".

So ... is there any possibility to remove that "rubberband"-effect and still have multiselection activated in the ListView? That's basically what I'd need to make this work.


Thanks in advance for your help,

Frank
Alexander Valchev
Telerik team
 answered on 22 Jun 2015
3 answers
121 views

When I export the scheduler to PDF it does not show the whole calendar but only the part that is visible without scrolling. Does the scheduler support something similar to the Kendo Grid's allPages attribute? I tried adding "addPages: true" to the the Pdf object in the scheduler configuration but it did not work. If this functionality is not supported at this time is there an ETA on when this functionality will be available? Is there a current work around that you might suggest?

 

Thanks in advance. 

T. Tsonev
Telerik team
 answered on 22 Jun 2015
2 answers
239 views
Space is at a premium for our page and the calendar shows an extra week.  For instance if I am showing the month of June it includes up to the 11th of July.  Is there a way to have it only show up to the 4th of July? ie: eliminate the last week?
Plamen Lazarov
Telerik team
 answered on 22 Jun 2015
1 answer
174 views

hi! 

I have 20 series, 10 of group "A" and 10 of group "B"

Is this possible?

best regards, markus

Iliana Dyankova
Telerik team
 answered on 22 Jun 2015
1 answer
144 views
Is there any known issues with sorting a grid column that is a bool value? I am getting error when ServerOperation is set to True. Works if I set server operation to false.
Nikolay Rusev
Telerik team
 answered on 22 Jun 2015
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?