Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
46 views

I use telerik web ui  2024.1.131.45 in my asp net web app. Using Rad Image Gallery the thumbnail is not showing (see attached). Any idea why?

Thanks before

 

Rumen
Telerik team
 answered on 02 Apr 2025
0 answers
52 views

HI Guys

I was wondering if you WebForms PdfViewer can accomplish updating fillable PDF and save the data entries into a new PDF, explain

I have a fillable PDF with a few fillable textboxes, and I would like to capture the user inputs and save as a new PDF for then later continue filling the blanks loading the new saved PDF.

I've tried accomplishing the task using iTextSharp but it was not possible here is my code for reference.


string existingPdfilePath = Server.MapPath("~/export/I-693_1000_202502191951256806.pdf");
 string updatedPdfPath = Server.MapPath("~/App_Data/I-693_" + Guid.NewGuid().ToString() + ".pdf");

 using (FileStream pdfReaderStream = new FileStream(existingPdfilePath, FileMode.Open, FileAccess.Read))
            {
                using (FileStream pdfWriterStream = new FileStream(updatedPdfPath, FileMode.Create, FileAccess.Write))
                {
                    PdfReader reader = new PdfReader(pdfReaderStream);
                    PdfStamper stamper = new PdfStamper(reader, pdfWriterStream);

                    AcroFields formFields = stamper.AcroFields;
                    foreach (DictionaryEntry de in reader.AcroFields.Fields)
                    {
                        //sb.Append(de.Key.ToString() + Environment.NewLine);
                        var fullname = formFields.GetTranslatedFieldName(de.Key.ToString());
                        formFields.RenameField(fullname, Guid.NewGuid().ToString("N"));
                        if (de.Key.ToString() != fullname)
                            if (!String.IsNullOrEmpty(de.Value.ToString()))
                            {
                                if (fullname != "form1[0].#pageSet[0].Page1[9].PDF417BarCode2[0]")
                                {
                                    formFields.SetField(de.Key.ToString(), de.Value.ToString());
                                }
                            }
                    }
                    stamper.Close();
                    reader.Close();
                }

As a PDFViewer I am using the plain html embed tag

 <embed class="pdf" 
               src=
"~/Templates/I-693_100_2025045512.pdf"
            width="800" height="500" />

The user data entries vanish like a ghost, and when saving it just make a copy of the original with no captured data entries

Can your PDFViewer accomplish the task?

Al
Top achievements
Rank 1
 updated question on 01 Apr 2025
1 answer
54 views

I am using Visual Studio 2019 c#

I have a telerik radgrid which has a column named StageStDate which is in string format but shows a date in format dd-mmm-yy. This column has filtering enabled with a date picker.

I have a hidden column named StageStartDate which is a replicate of StageStDate but is a date column and in format DD/MM/YYYY.

As StageStDate wont filter correctly as its a string format, when user select a date for this column from filter I would like the filtering to apply to the StageStartDate column, how can I achieve this please?

On ItemCommand I have changed the Pair Second to StageStartDate instead of StageStDate

 

but for some reason this makes the filterExpression blank.

Rumen
Telerik team
 answered on 31 Mar 2025
1 answer
84 views

Hi there,

I am currently trying to figure out a problem with the display of the calendar in the ASP AJAX RadDateTimePicker control. It seems like the bottom shadow of the calendar is either offset or the calendar is a little too short and causes a gap between the calendar pane and the shadow.



Even after stripping away ALL possible conflicting CSS, the above image is still what we get. I am using a standard RadDateTimePicker control without any embellishments. Literally, just:

<telerik:RadDateTimePicker ID="myID" runat="server"></telerik:RadDateTimePicker>

Has anyone seen this issue before? 

Cheers

Gareth

 

Rumen
Telerik team
 answered on 28 Mar 2025
1 answer
52 views
I'm trying to add a alert inside the FileStore method in Telerik's File Explorer, but it's not working as expected. Here's my implementation:

public override string StoreFile(UploadedFile file, string path, string name, params string[] arguments)
{          
    string physicalPath = this.GetPhysicalFromVirtualPath(path);
    if (physicalPath == null)
        return string.Empty;

    Directory.CreateDirectory(physicalPath);

    // sanitize the file name
    name = (name.Replace(" ", "_")).Replace("'", string.Empty);
    physicalPath = PathHelper.AddEndingSlash(physicalPath, '\\') + name;
    
    string fileName = Path.GetFileName(physicalPath);
    string folderPath = Path.GetDirectoryName(physicalPath);
      
    FileStorageManager fileStorageManager = new FileStorageManager();
    FileStorageInformation fileInfo = fileStorageManager.GetFileByFolderAndFileName(_applicationID, folderPath, fileName);

    string fileFolderRelativeToRoot = path;
    string rootToThisContext = path;
    string message = null;

    if (File.Exists(physicalPath))
    {
        bool isVersioningDisabledOnDestination = false;
        UploadingHandler uploadingHandler = new UploadingHandler();
        uploadingHandler.ExecuteAction(fileInfo, fileName, fileFolderRelativeToRoot, rootToThisContext, _applicationID, _formID, _userID, ref isVersioningDisabledOnDestination);

        if (isVersioningDisabledOnDestination)
        {
            message = string.Format("Can not upload - versioning not enabled on target folder");
        }
    }

    if(message == null)
    {
        file.SaveAs(physicalPath);

        return PathHelper.AddEndingSlash(path, '/') + name;
    }
    else
    {
        return message;
    }         
}
Rumen
Telerik team
 answered on 28 Mar 2025
1 answer
80 views

Hello,

I was notified that one of the sites I developed is returning a vulnerability to cross site scripting.  I have already tried many ways to correct this issue with code and content security policy changes.  I still can't get rid of this vulnerability.  We are using Progress® Telerik® UI for ASP.NET AJAX runtime version: v4.0.30319 version: 2020.1.114.45.  Can I download the trail of asp.net ajax and try that version of the treeview and see if that corrects the issue?

Issue Detail

The value of the scrollPosition JSON parameter within the ctl00_ContentPlaceHolder1_VIndex2_tvIndex_ClientState parameter is copied into the HTML document as plain text between tags. The payload sbi7s<script>alert(1)</script>tx52l was submitted in the scrollPosition JSON parameter within the ctl00_ContentPlaceHolder1_VIndex2_tvIndex_ClientState parameter. This input was echoed unmodified in the application's response.

Request

older1_VIndex2_tvIndex_ClientState=%7b%22expandedNodes%22%3a[]%2c%22collapsedNodes%22%3a[]%2c%22logEntries%22%3a[]%2c%22selectedNodes%22%3a[]%2c%22checkedNodes%22%3a[]%2c%22scrollPosition%22%3a%220**sbi7s%3cscript%3ealert(1)%3c%5c%2fscript%3etx52l**%22%7d&ctl00_RadWindowManager1_ClientState=&__ASYNCPOST=true&ctl00%24ContentPlaceHolder1%24VIndex2%24btnAddCart=Add%20To%20Cart

Response

> HTTP/2 200 OK
> Cache-Control: no-cache 
> Pragma: no-cache 
> Content-Type: text/plain; charset=utf-8 
> Expires: -1 
> Server: Microsoft-IIS/10.0 
> X-Powered-By: ASP.NET 
> X-Frame-Options: SAMEORIGIN 
> X-Ua-Compatible: IE=edge,IE=11,IE=10,IE=9,IE=8,IE=7 
> Strict-Transport-Security: max-age=31536000 
> Date: Wed, 19 Mar 2025 16:26:27 GMT 
> Content-Length: 82 
> 68|error|500|0**sbi7s<script>alert(1)</script>tx52l** is not a valid value for Int32.|

What is the best way to pinpoint this issue?  How can I look at the scrollposition and how is that causing this issue?

How do I fix this so it isn't showing up on the scans?

Thank you

Rumen
Telerik team
 updated answer on 27 Mar 2025
3 answers
367 views

We have an application that uses RadGrid and one of our clients recently performed a penetration test on our application and identified the hidden input _ClientState as a vulnerability because they were able to trigger a buffer overflow error.

Here is the relevant code from the test where ClientState=AAA repeats ...

ctl00_ctl00_MainContent_MainContent_MyRequestGrid1_MyRequestCustomRadGrid_ClientState=AAAAAAAAAAAAAAAAAAAAAAAA 

Is there a way to prevent this from happening? Perhaps some way to set the max length for this hidden input or some other technique that we can utilize to mitigate this vulnerability?

We are using Telerik RadControls for ASP.NET Ajax.

For reference, there is another thread related to this topic (i.e., ClientState hidden field) where my colleague posted a similar question but received no response - http://www.telerik.com/forums/what-is-clientstate-input-hidden-for

Rumen
Telerik team
 updated answer on 27 Mar 2025
2 answers
282 views

Hello

we have an application that needs to be put behind a reverse proxy for security reasons. The URLs in the app all need to point to the reverse proxy URLs. However, the URLs for web resources and the dynamically generated JavaScript URLs point to the backend server, so a lot of functionality is broken. We have no possibility to modify reverse proxy rules.

Is there any way to modify or rewrite  the dynamically generated URLs and the web resource URLs ? We tried intervening the page rendering, some stuff works, but a lot of other things do not.

Thanks! 

 

Rumen
Telerik team
 answered on 25 Mar 2025
1 answer
60 views

Hi,

 

I isolated this script to display overlay drawer but it not working properly, what am I missing?:

 

               <script>
                   function showDrawer(sender, args) {
                       $find("<%= OverlayDrawer.ClientID %>").show();
            }
 
            function hideDrawer() {
                $find("<%= OverlayDrawer.ClientID %>").hide();
                   }
               </script>

        <style>

            .drawer-content {
    height: 200px;
    padding: 1em;
}
 
.RadDrawer.borderless-drawer {
    border: 0;
}
 
div.k-widget.k-drawer {
    z-index: 42002;
}
        </style>
         <asp:Button Width="100" ID="ShowDrawer" Text="Show" AutoPostBack="false" runat="server" OnClientClicked="showDrawer" />
                            <asp:Button Width="100" ID="HideDrawers" Text="Hide" AutoPostBack="false" runat="server" OnClientClicked="hideDrawer" />


       <telerik:RadDrawer runat="server" ID="OverlayDrawer" Skin="Silk" CssClass="borderless-drawer" Position="Right" SwipeToOpen="false">
            <ItemsTemplate>
                 <ul> 
                    <li data-role='drawer-item'><span class='k-item-text'>First Item</span></li>
                    <li data-role='drawer-separator'></li>
                    <li data-role='drawer-item'><span class='k-item-text'>Second Item</span></li> 
                    <li data-role='drawer-item' class='k-state-selected'><span class='k-item-text'>Third Item</span></li> 
                    <li data-role='drawer-separator'></li> 
                    <li data-role='drawer-item'><span class='k-item-text'>Last Item</span></li> 
                </ul>
            </ItemsTemplate>
        </telerik:RadDrawer>
Vasko
Telerik team
 answered on 18 Mar 2025
1 answer
92 views

I checked the demo at https://demos.telerik.com/aspnet-ajax/window/examples/rendermodes/defaultcs.aspx?skin=MetroTouch with render mode set to classic in Chrome's Dev Tools > Mobile device emulator. I noticed a vertical line between the td cells in the title bar row as shown in screenshot below. I also noticed a similar issue with Metro skin in classic render mode. If I view the same in non-mobile mode in Chrome then this issue disappears. Perhaps, its some styling issue, but I could not find any CSS causing this.

It makes the title bar look non-uniform and not good in appearance.

What is causing the break among the td cells in the title bar for this case? (i.e. vertical line can be seen where the first td cell in title bar ends and then where the third td cell begins)

However, I did find a workaround solution using the  jquery code below. 

$(".RadWindow:visible").each((index, emt) => {
    $(this).find("tr.rwTitleRow td.rwTopLeft, .RadWindow tr.rwTitleRow td.rwTopRight").css("display", "none");
    $(this).find("tr.rwTitleRow td.rwTitlebar").attr("colspan", "3");
});

Vasko
Telerik team
 answered on 17 Mar 2025
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?