New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

How to Obtain Telerik.Web.UI Version Number Programmatically?

Updated over 6 months ago

How to

Obtain the version number of the currently referenced Telerik.Web.UI dll or another assembly referenced in your project.

Description

Sample ASPX page

ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
           <asp:Label id="ProductVersion1" runat="server" />
    </form>
</body>
</html>

Code-behind logic

C#
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        // Get the file version.
        System.Diagnostics.FileVersionInfo myFileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(Server.MapPath("~/Bin/Telerik.Web.UI.dll"));

        // Print the file name and version number.
        ProductVersion1.Text = "File: " + myFileVersionInfo.FileDescription + '\n' +
                            "Version number: " + myFileVersionInfo.FileVersion;
    }
}

The result:

sample image

In this article
How toDescription
Not finding the help you need?
Contact Support