Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
498 views
I have a very simple test page that contains the following:
RadAjaxManager
RadScriptManager
RadUpload
RadWindowManager
input type="button" x 2

The input buttons fire client-side events that cause an ajaxRequest.
This only works with the first ajaxRequest. Thereafter the  $find("<%= RadAjaxManager1.ClientID %>"); does not find the RadAjaxManager

<head runat="server"> 
    <title></title> 
    <telerik:RadCodeBlock ID="cb1" runat="server"> 
 
        <script type="text/javascript"> 
 
            function InitiateAjaxRequest(arguments) { 
                var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
                if (ajaxManager) ajaxManager.ajaxRequest(arguments); 
            }            
          
        </script> 
 
    </telerik:RadCodeBlock> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
 
        <script type="text/javascript"> 
 
            function OnClientFileSelected(radUpload, eventArgs) { 
                var input = eventArgs.get_fileInputField(); 
                var FileString = "UploadFile" + "|" + input.value; 
                InitiateAjaxRequest(FileString); 
            } 
 
            function confirmCallBackFn(arg) { 
                result = radalert("Confirm returned the following result: " + arg); 
                InitiateAjaxRequest('confirm|' + result); 
            } 
 
        </script> 
 
        <div> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> 
            </telerik:RadAjaxManager> 
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
            </telerik:RadScriptManager> 
        </div> 
        <div> 
            <telerik:RadUpload ID="RadUpload1" runat="server" Skin="Forest" OnClientFileSelected="OnClientFileSelected"> 
            </telerik:RadUpload> 
        </div> 
        <div> 
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server"> 
            </telerik:RadWindowManager> 
        </div> 
        <div> 
            <input id="Button1" type="button" value="clientside button" onclick="javascript:InitiateAjaxRequest('btn|a');" /> 
        </div> 
        <div> 
            <input id="Button2" type="button" value="show CONFIRM BOX" onclick="radconfirm('Are you sure?', confirmCallBackFn); return false;" /> 
        </div> 
 
    </div> 
    </form> 
</body> 
I have tried the  setTimeout("InitiateAjaxRequest(FileString);", 0); trick but it does not make a difference.


Gotcha
Top achievements
Rank 1
 answered on 04 Dec 2012
1 answer
234 views
I have a page where the user can change an address, and when they click Update, I need to run some javascript on the page to ask if they want to change some related addresses, THEN run the code on the server.

So on the .aspx page I have a javascript function:

 

 

 

function confirmAddressChange()
{
    if (document.forms[0].hfAddressChange.value =="")
    { 
     var res = (confirm('Update Contact Addresses to Match?')==true);
     document.forms[0].hfAddressChange.value = res;    
    }
    return true;
}

and on the RadMenuItem I have:  BTW, I've tried onClick, onItemClick, onclick and the one in the code now.

 

<rad:RadMenuItem ID="rmitmUpdateInfo" runat="server" ImageUrl="~/Images_ABL_Std/Grid/Update.gif"
    Text="Update" Value="update" ToolTip="Accept changes" OnClientItemClicking ="confirmAddressChange()">
</rad:RadMenuItem>

What I need to happen is to have the page run the javascript, where I set the value of a hidden field, then run the server code.  At this point it skips the javascript and goes directly to the server code.

Anyone have a suggestion or answer?

Thanks.

 

Boyan Dimitrov
Telerik team
 answered on 04 Dec 2012
1 answer
98 views
Is this function disable?  I need to post a PNG file when I reply on the forum.
Plamen
Telerik team
 answered on 04 Dec 2012
1 answer
181 views
Hi All,

I have a problem regarding javascript. When I am using external javascript(for validation purpose) in aspx page, its working fine. But when i am using external javascript to validate telerik controls, it is showing some errors. So kindly guide me how I can solve my issue.


// This following code works fine.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script language="javascript" type="text/javascript">
            function Delete_Confirm(sender, args) {
                var selRowCount = -1;
                selRowCount = $find("<%=rgDocument.ClientID %>").get_masterTableView().get_selectedItems().length;

                if (selRowCount > 0) {
                    radconfirm('Sure to delete?', deleteConfirmCallbackFn, 330, 100, null, 'Example', null);
                }
            }

            function deleteConfirmCallbackFn(args) {
                if (args) {
                    __doPostBack('toolBar', 'Delete');
                }
            }
        </script>
    </telerik:RadCodeBlock>


Now i have written the above script in "CommonJS.js" and included it in to "RadCodeBlock". But I am getting the error "function not defined.".


<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript" src="js/CommonJS.js"></script>
                
        </script>
    </telerik:RadCodeBlock>


Thanks and Regards
Shajan P K
Eyup
Telerik team
 answered on 04 Dec 2012
0 answers
205 views
Hello Telerik team,

I have tried this article http://www.sitefinitywatch.com/blog/09-06-16/Email_Notification_about_New_Blog_Comments.aspx in sitefnity project. but in project , in bin folder there is not found telerik.cms.engine.dll .

I have tried to downoad telerik.cms dlls from telerik site but not found. Please can you suugest us from where we can download telerik dlls.



Thanks & Regards,
Anal Kukadiya  
Anal
Top achievements
Rank 1
 asked on 04 Dec 2012
1 answer
71 views
Hi Telerik team,

In my rad grid Edit popup, I'm saving the excel data to the DB and importing it to the server.It is taking a lot of time to save the data to DB and import an excel sheet[as it contains many rows] to the server.so I want to make this process as Back ground process[Threads] so that i can access other pages till it completes.

I have used the below format..
Event :
protected void btn_Save(sender o,Eventargs e)
{
 Thread obj = new Thread(new ThreadStart(SaveData));
             obj.IsBackground = true;
}
Method:
public void SaveData()
{
....
....
}
It is not working...
when the editpopup is opened the background grid is covered with Opacity.
Kostadin
Telerik team
 answered on 04 Dec 2012
1 answer
314 views
Hi,
FAQ Sitefinity: "No, the Sitefinity Community Edition does not allow commercial use. "
What is the commercial use?
For example, it is authorized to make a site on this version for nursery of dogs or for veterinary clinic?
Make please clarification.
Thanks.
Vlad
Dale
Top achievements
Rank 1
 answered on 04 Dec 2012
1 answer
83 views
Hi,

Reminder pops up a list of appointments in Scheduler and when I click on Dismiss All/Snooze for 1 hour, I expect   it to stay silent for the selected timeframe however any postback form scheduler or  a page causes it to show again. Why does not  snooze /dismiss persist postback?   

Thanks,
Prava
Plamen
Telerik team
 answered on 04 Dec 2012
3 answers
155 views

Heey

I have a strange error when i try to uppdate my data in db an Error appears( Value of '0001-01-01 00:00:00' is not valid for 'SelectedDate'. 'SelectedDate' should be between 'MinDate' and 'MaxDate'. Parameter name: SelectedDate)

Story: I have a grid in in my UserEditPanel where i try to create users that works perfectly but in this same UserEditPanel there is a little gird where you can add (with new record button) FromDate ToDate WorkingTime and VacationDays for one user that is in same time how to say in creation . if I try to save/update it wont it just reset only in the fields FromDate and ToDate to (0001-01-01 00:00:00') some help would be just awesome btw i'm working with Viewstate

I think that the error appears in this part of the code and i really dont know what is wrong here ...


Code 

       <telerik:RadDatePicker ID="fromdatepicker" runat="server" DbSelectedDate='<%# Eval("FromDate") == null ? null : Eval("FromDate") %>' TabIndex="4">
                                                        </telerik:RadDatePicker>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>To</td>
                                                    <td>
                                                        <telerik:RadDatePicker ID="todatepicker" runat="server" DbSelectedDate='<%# Eval("ToDate") == null ? null :Eval("ToDate")%>'
                                                            TabIndex="4">
                                                        </telerik:RadDatePicker>


<
asp:Button ID="btnUpdate"  Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button> 
                                            </div>
                                        </td>
                                        <td>
                                            <asp:Button  ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                CommandName="Cancle" OnClick="btnCancel_Click"></asp:Button>
                                        </td>
                                    </tr>
                                </table>
                        </FormTemplate>
                    </EditFormSettings>
                 </MasterTableView>
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
    </div>
    <div class="BackAndSave">
        <telerik:RadButton ID="rbBack" CssClass="rowButton" runat="server" Text="Back" OnClick="rbBack_Clicked"
            CausesValidation="false" />
        <telerik:RadButton ID="rbSave" CssClass="rowButton" runat="server" Text="Save" OnClick="rbSave_Clicked" />


nothing special just some buttons & fields  



code behind 

the error appears here (exitingAnnualVacation.FromDate = editedAnualVacation.FromDate;) the second from date is reset

protected void rgAnnualVacation_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        try
        {
            GridEditableItem item = e.Item as GridEditableItem;
            Hashtable values = new Hashtable();
            item.ExtractValues(values);
 
            AnnualVacation editedAnnualVacation = new AnnualVacation();
            item.UpdateValues(editedAnnualVacation);
          //newAnnualVacation.IsNew = true;
            List<AnnualVacation> annualVacationSource = (List<AnnualVacation>)ViewState["AnnualVacationSource"];
            AnnualVacation existingAnnualVacation = annualVacationSource.Where(av => av.AnnualVacationId == editedAnnualVacation.AnnualVacationId).FirstOrDefault();
            existingAnnualVacation.WorkingTime    = editedAnnualVacation.WorkingTime;
            existingAnnualVacation.VacationDays   = editedAnnualVacation.VacationDays;
            //Set values to zero when update
            existingAnnualVacation.FromDate = editedAnnualVacation.FromDate;
            existingAnnualVacation.ToDate   = editedAnnualVacation.ToDate;
        }
        catch
        {
            //Hier fehlermeldung
        }
    }



Thanks for help and fast answer !!
Angel Petrov
Telerik team
 answered on 04 Dec 2012
1 answer
120 views

Hello,

I have created a page on which there is a hyperlink when clicked, it will open a new asp.net page shown in a JQuery UI Dialog box and the new page contains some basic telerik controls such as RadDatePicker and RadDropDown.

The page is shown correctly but the telerik controls inside the dialog are not working at all.My Project is using Microsoft .NET Framework 4.0 and the Telerik.Web.UI dll is also for Framework 4.0.

After too much research, I found that when I change the Target Framework of my Project to 3.5, the controls start working smoothly and when I revert the target framework to 4.0, the controls doesn't work.

Kinldy let me know if someone has any idea about this cause I am really struggling because of this issue.
Vasil
Telerik team
 answered on 04 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?