Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
177 views
Hi,

I have an issue about EditableImage. I'm trying to resize images but i get some exceptions like "Image stream seems to be causing issues" or "The source of the image seems to be invalid".

It doesn't throw exceptions always. Only some images couse the error. For example I attached two image. Org is the original image. And the other is edited image.

Org gives error. When i edit in photoshop and resize width to 750px it works.

My code is here :

protected void btnAddImage_Click(object sender, System.EventArgs e)
        {
            Stream StreamImage = flImage.PostedFile.InputStream;
            MemoryStream ms = new MemoryStream();
 
            byte[] imgData = new byte[StreamImage.Length];
            StreamImage.Read(imgData, 0, imgData.Length);
 
            ms.Write(imgData, 0, imgData.Length);
 
            SaveImage(ms, "g_" + PhotoID.ToString(), 610, 610);
        }
 
        void SaveImage(MemoryStream ms, string FileName, int Width, int Height)
        {
            try
            {
                EditableImage image = new EditableImage(ms);
                decimal oran = 0;
                Size s;
                if (!(Width > image.Width && Height > image.Height))
                {
                    if ((Width / Convert.ToDecimal(image.Width)) > (Height / Convert.ToDecimal(image.Height)))
                    {
                        //Height
                        oran = Height / Convert.ToDecimal(image.Height);
                        s = new Size(Convert.ToInt32(oran * image.Width), Convert.ToInt32(oran * image.Height));
                    }
                    else
                    {
                        //Width
                        oran = Width / Convert.ToDecimal(image.Width);
                        s = new Size(Convert.ToInt32(oran * image.Width), Convert.ToInt32(oran * image.Height));
                    }
                    image.Resize(s);
                }
 
                image.Image.Save(Server.MapPath(Settings["FolderPath"].ToString() + FileName + ".jpg"), System.Drawing.Imaging.ImageFormat.Jpeg);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Thanks for your help.
Erkan Şahan
Top achievements
Rank 1
 answered on 09 Feb 2012
2 answers
286 views
Hi,

I am using rad datepicker and i am clearing it if today or future date is selected and i am using it as below
Note: IT IS USED IN GRID'S EDIT FORM SETTING.

 function OnToDateSelected() {
                var HidCurrentDate = document.getElementById("ctl00_MainContent_hidCurrentDate");
                var CurrentDate = DateConversionForHidden(HidCurrentDate.value);

                var ServerIdRadioBtnlst = "rblOwnerTypeC";
                var tagNameRblbtnList = "input";
                var rblListC = GetGridServerElement(ServerIdRadioBtnlst, tagNameRblbtnList);//this will find the id of control used in grid in js

                var ServerIdRadioBtnlst = "rblOwnerTypeP";
                var tagNameRblbtnList = "input";
                var rblListP = GetGridServerElement(ServerIdRadioBtnlst, tagNameRblbtnList);
                if (rblListP.checked == true) {

                    var serverIDTo = "rdpPeriodTo";
                    var tagNameTo = "input";
                    var rdpPeriodTo = GetGridServerElement(serverIDTo, tagNameTo);
                    var ToDate = DateConversion(rdpPeriodTo.value);

                    if (ToDate >= CurrentDate) {
                        alert("you can't use current or future date in previous Owner");
                        rdpPeriodTo.clear();
                        return false;
                    }

                }
             
            }

<telerik:RadDatePicker ID="rdpPeriodTo" runat="server" Width="105px" Style="float: left;
                                            margin: 10px 0px 0px 0px;" ClientEvents-OnDateSelected="OnToDateSelected">
                                            <DateInput ID="DateInput2" runat="server" Font-Names="Georgia" >
                                            </DateInput>
                                            <Calendar ID="Calendar2" runat="server" ShowRowHeaders="false">
                                                <SpecialDays>
                                                    <telerik:RadCalendarDay Repeatable="Today" Date="">
                                                        <ItemStyle CssClass="rcToday" />
                                                    </telerik:RadCalendarDay>
                                                </SpecialDays>
                                            </Calendar>
                                        </telerik:RadDatePicker>

above functionality is showing javascirpt error "Error: rdpPeriodTo.clear is not a function". I think it is not working due to rad date picker used in Grid .... but i am getting the id of that rad date picker by using GetGridServerElement() method (provide by telerik). Please help me it is urgent.
Manish
Top achievements
Rank 2
 answered on 09 Feb 2012
3 answers
87 views
Hi,
We are using Telerik Rad Combobox in many pages of multiple applications. All pages were working fine till recently.

All of a sudden users are not able to filter data in Combobox by typing keywords. The filtering is not working properly and also results in the below error in almost all pages.

"Stop running this script? A Script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Yes / No" 

This happens in multiple applications hosted on multiple servers.
Any idea on how to troubleshoot this issue?

Our applications are running on .Net 2.0 and Telerik version is 2008.2.826.20

Thanks in advance,
Muhammed Saleem
Simon
Telerik team
 answered on 09 Feb 2012
10 answers
287 views
I've built a control which is a checkbox, grid, and RadAjaxManagerProxy.  When a grid or checkbox event is raised, I put a loading panel over the grid while I'm working.  This works great in two of the three places I use it.

In the first instance, this control is used a single time in a page without a master page--the page has the RadAjaxManager directly. Works great.

In the second, this control is used multiple times in a page whose master page has the RadAjaxManager.  Works great.

The one which isn't working is a situation where my control is in a page which uses the same master as #2.   It works great when I don't try to ajax this page's buttons (which are Peter Blum controls, if that matters).  However, in this page, what I'd like to have happen is to ajax buttons in the page (but outside my control), then make my control become visible after save.

It might be important to note that when page #3's buttons are not ajax-ified, things work great; my control becomes visible and useable after the full postback.  I'm just trying to add a nice indication to the user that the save is working, since it takes a couple of seconds (on dev, anyway).

I add the pieces step-by-step to page #3: first the RadAjaxManagerProxy, test --> good. Next, I make my save button the AjaxSetting and the updated control, showing a loading panel over it, test --> good.  Works great up to this time except (of course) my control doesn't see the state change from invisible to visible.

As soon as I add my control to the list of AjaxUpdatedControls, my control becomes visible after the Save button (yay!).  Unfortunately, when I try to use it (say, click the grid's 'Add' CommandItem, I get the old javascript null-reference sort of exception deep within telerik's javascript.

Based on this testing, I'm thinking that the control is getting confused by the 'stacking' of RadAjaxManagerProxy elements, or (possibly).  My second use of the control shows that RadAjaxManagerProxy can successfully see a RadAjaxManager more than one level up, but in page #3 I have a RadAjaxManagerProxy siting in the page between my control and master, and it seems that's what casuing the problem.

Anyway, any ideas how I can add ajax to both the page and the control included in the page, while also allowing the control to be used in other places which may or may not have ajax?

Thanks a million,

Scott

Maria Ilieva
Telerik team
 answered on 09 Feb 2012
3 answers
129 views


Hello Support Team,

 

I have a query, so I need your help that I am using RadSlider control, as you know that there are imagebuttons on both of side slider control, but does not skip to the next image that is between the next dotted vertical lines. Could we change the left and right scrolling to skip to the next image instead of scrolling through the images. I have also attached an image, so you can grab it.

 

Have a nice day.

Mark Rowe
Top achievements
Rank 1
 answered on 09 Feb 2012
0 answers
182 views
hi friends,
 i doing a validation on client side to insert a values.
the javascript script validation code are
function validate() {
 if (document.getElementById("<%=rcmbcurrencycode.ClientID%>").value == "Select") {
                alert("Currency Code can not be blank");
                return false;
            }
if (document.getElementById("<%=rtxtinteresttype.ClientID%>").value == "") {
           alert("Interest Type can not be blank");
           return false;
}
}
 
but my problem is , i can not validated length of the string  and to check numeric or alphabetic for currency and name and age

i used following snippets of code check the data are characters are not
var alphaExp = /^[a-zA-Z]+$/;
       if (document.getElementById("<%=rtxtinteresttype.ClientID%>").value == "") {
           alert("Interest Type can not be blank");
           return false;
           if (rtxtinteresttype.value.match(alphaExp)) {
               return true;
           }
           else {
               alert("pls enter only numbers");
               return false;
           }
       }

but its not working for me.
can anyone tell me what mistake i have done in this code.
thanks in advance
S.Rajkumar
Raj
Top achievements
Rank 1
 asked on 09 Feb 2012
2 answers
99 views
I Have an error with RadWindows... in FireFox I see like that




But in IE I see that



How I can fix this?
July
Top achievements
Rank 2
 answered on 09 Feb 2012
4 answers
122 views
Hi All

I currenly have a Row click event that recognized if a certain cell has been clicked, the Javascript then opens a window and passes certain values to the window from the row.
I want to pass some values from Hidden columns however i cannot get the value unless the column is either visible or display = false,
If i set the display to False this then completely confuses the Row Click event, So i have set the columns to zero width to overcome the problem.

However i would really like to hide these columns, so my question: is there "Any" way using java to get the cell value if the associated column is hidden?

Many Thanks

Regards

Darren
Pavlina
Telerik team
 answered on 09 Feb 2012
4 answers
219 views
Hello,

I have to create a custom menu in sitefinity that must match & respect my design 100%. Unfortunately, I couldn't find any tutorial that shows step by step what i have to do. As far as i've seen there is a Navigation control that allows you to customize your menu by giving a css file or a template. In traditional html/css sites i would crop my buttons from the design and would integrate them in the design with an <a href=""><img src=""></a>.
How should i do it?
Another problem i am dealing with is that i have to create a multi language website. So i would use the Language Selector control. Can i use it and have different content in the pages? For instance in the English Language page, i would have 4 columns in a widget, and in the German Language page i would have only 3 columns, and different pictures, content, etc?
Please give me some hints, tutorials or anything that could put me on track.
Thanks.

Edit: I am not interested in drop-down menus, i want a simple linear menu. I tryed the navigator control and it generated me only one button, because i am working on the home page template. Should i create the whole structure of the website and then create the menu? This way sitefinity will generate all the buttons for all the pages?
Thanks
Jen Peleva
Telerik team
 answered on 09 Feb 2012
2 answers
377 views
How to remove the tooltip from RadCaptch Refresh Button as it is showing the Path of the image. Attached screenshot.
Also let us know if we need any custom tooltip how to set for Captch Refresh Button.
Slav
Telerik team
 answered on 09 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?