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

[Solved] Show Full Month Name and Full Path in AsyncUpload.

3 Answers 260 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Missing User
Missing User asked on 16 Aug 2015, 03:32 PM

Using UI for ASP.NET AJAX Q1 2015 SP1 with VS 2013.
1) I would like to get Full Month Name (i.e. August, September etc..) from RadMonthYearPicker instead of integer value (i.e. 8, 9 etc). Refer to attachment_#_1.  code is here.

<telerik:RadMonthYearPicker ID="RadMonthYearPicker1"   AutoPostBack="true"  OnSelectedDateChanged ="btnSubmit_Click" runat="server"></telerik:RadMonthYearPicker>
 protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string startmonth_year = RadMonthYearPicker1.SelectedDate.Value.Month.ToString() + " , " + RadMonthYearPicker1.SelectedDate.Value.Year.ToString();
        DateTime selectedDate = RadMonthYearPicker1.SelectedDate.Value;
        DateTime startDate = selectedDate.AddDays((selectedDate.Day - 1) * -1);
        DateTime endDate = startDate.AddDays(DateTime.DaysInMonth(startDate.Year, startDate.Month) - 1);
        Response.Write("Start Month and Year: "+startmonth_year + ' ' +  ' ' + ". Start Month beginning/end date: "+startDate.ToShortDateString() + " - " + endDate.ToShortDateString());
    }
2) How I can pass full file name path (\\Your_Server_Name\Your_Folder_Name\Your_File.csv) to Stored Procedure as Parameter or SSIS as variable? Or store the full file name path in string or session variable.

3) How I can show full file name path in Upload AsyncUpload  (i.e. \\Your_Server_Name\Your_Folder_Name\Your_File.csv). Refer to attachment_#2.

 

Thanks a lot

3 Answers, 1 is accepted

Sort by
0
Missing User
answered on 16 Aug 2015, 03:35 PM
sorry attachment # is here
0
Missing User
answered on 16 Aug 2015, 03:37 PM
Attachment#1 & #2 is here.
0
Viktor Tachev
Telerik team
answered on 19 Aug 2015, 02:51 PM
Hello,

Thank you for contacting Telerik Support.

1. I have examined the code and it seems that you are using the SelectedDate property of RadMonthYearPicker. Note that it returns DateTime? object. In order to retrieve the full month name from it you can use the "MMMM" custom format specifier. Check out the following article that elaborates more on the matter.


The code snippet below illustrates the approach:

protected void RadMonthYearPicker1_SelectedDateChanged(object sender, SelectedDateChangedEventArgs e)
{
    DateTime? selectedDate = (sender as RadMonthYearPicker).SelectedDate;
 
    string monthName = selectedDate.Value.ToString("MMMM");
}


2. See 3.

3. You cannot get and show the file location when selecting a file for upload with RadAsyncUpload. Due to security reasons the browser will allow only the file name to be retrieved.

Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Upload (Obsolete)
Asked by
Missing User
Answers by
Missing User
Viktor Tachev
Telerik team
Share this question
or