Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
373 views
using 2014.3.1024.45. I am using a RadGrid with checklist filtering, nothing special. Wen two options from the listbox are checked, the radgrid doesn't filter properly, also when two or more columns are filtered at the same time. here's my markup
<telerik:RadGrid ID="grdProjects" runat="server" AllowFilteringByColumn="True" AllowSorting="True" AutoGenerateColumns="False" OnItemCreated="grdProjects_ItemCreated" FilterType="CheckList"
        GroupPanelPosition="Top" ShowGroupPanel="True" OnNeedDataSource="grdProjects_NeedDataSource" AllowPaging="True" ShowFooter="True" CellSpacing="-1" GridLines="None" OnFilterCheckListItemsRequested="grdProjects_FilterCheckListItemsRequested">
        <ClientSettings AllowDragToGroup="True" ClientEvents-OnRowClick="openProject">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <ItemStyle CssClass="popup-trigger" />
        <AlternatingItemStyle CssClass="popup-trigger" />
        <MasterTableView DataKeyNames="ProjectID,IsLead" ClientDataKeyNames="ProjectID,IsLead">
            <Columns>
                <telerik:GridBoundColumn Visible="false" DataField="ProjectID">
                    <ColumnValidationSettings>
                        <ModelErrorMessage Text=""></ModelErrorMessage>
                    </ColumnValidationSettings>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Title"  AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" FilterControlWidth="250" HeaderText="Title" UniqueName="Title" DataType="System.String" Aggregate="Count" FooterText="Total Projects:">
                    <ColumnValidationSettings>
                        <ModelErrorMessage Text="" />
                    </ColumnValidationSettings>
                    <ItemStyle Width="45%" />
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn FilterControlAltText="Filter ResponsibleOfficerID column"  FilterCheckListEnableLoadOnDemand ="true"  HeaderText="Responsible Officer" UniqueName="ResponsibleOfficerID" DataField="NAME" SortExpression="Name">
                    <ItemTemplate>
                        <table style="width: 100%;" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td style="width: 40px;">
                                    <img src="<%# Eval("SThumbPath") %>" width="38px" /></td>
                                <td nowrap="nowrap"><%# Eval("NAME") %></td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
 <telerik:GridBoundColumn HeaderText="Template" UniqueName="TemplateName" DataField="TemplateName" FilterCheckListEnableLoadOnDemand="true" FilterListOptions="VaryByDataType">
                    <ColumnValidationSettings>
                        <ModelErrorMessage Text=""></ModelErrorMessage>
                    </ColumnValidationSettings>
                </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn HeaderText="Current Stage" UniqueName="CurrentStage" DataField="CurrentStage" FilterCheckListEnableLoadOnDemand="true" >
                    <ColumnValidationSettings>
                        <ModelErrorMessage Text=""></ModelErrorMessage>
                    </ColumnValidationSettings>
                </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn HeaderText="Status" UniqueName="Status" DataField="Status" DataType="System.String" SortExpression="Status"  FilterCheckListEnableLoadOnDemand="true">
                    <ColumnValidationSettings>
                        <ModelErrorMessage Text=""></ModelErrorMessage>
                    </ColumnValidationSettings>
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
 
    </telerik:RadGrid>


and my code behind

protected void grdProjects_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
       {
           string DataField = (e.Column as IGridDataColumn).GetActiveDataField();
           var ds = ProjectModel.GetAllProjects();
           switch (DataField)
           {
               case "ProjectID":
                   e.ListBox.DataSource = ds.Select(p => p.ITCProjectID).OrderBy(p => p).Distinct().ToList();
                   break;
               case "Title":
                   e.ListBox.DataSource = ds.Select(p => p.Title).OrderBy(p => p).Distinct().ToList();
                   break;
               case "NAME":
                   e.ListBox.DataSource = ds.Select(p => p.NAME).OrderBy(p => p).Distinct().ToList();
                   break;
               case "TemplateName":
                   var list = ds.Select(p => p.TemplateName).Distinct().ToList();
                   list.Add("Project Lead");
                   list = list.OrderBy(l => { return l; }).ToList();
                   e.ListBox.DataSource = list;
                   break;
           }

can anyone help please. I have been cracking my head with this for 2 hours now with no luck. thanks
Viktor Tachev
Telerik team
 answered on 20 Mar 2015
1 answer
362 views
I am attempting to create a TreeView with Tri-State Checkboxes. However, I want tri-state checkboxes right down to bottom level of the tree, not just to represent mixed selection of attributes on a parent node. Every node must have the ability to be tri-state. This doesn't seem possible using the built in checkbox capability of the TreeView, so what I've done is use a TreeView Template and embed a RadButton Type=ToggleType with tri-state functionality. As Such:

<telerik:RadTreeView runat="server" ID="RadTreeView1">
        <NodeTemplate>
            <telerik:RadTreeNode Text="<%# DataBinder.Eval(Container.DataItem, "Name") %>">
            <NodeTemplate>
            <telerik:RadButton OnClientCheckedChanged="GetSiblings" ID="RadButton1" runat="server" ToggleType="CustomToggle" ButtonType="ToggleButton" AutoPostBack="false" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'>
                <ToggleStates>
                    <telerik:RadButtonToggleState Value="Unchecked" PrimaryIconCssClass="rbToggleCheckbox"></telerik:RadButtonToggleState>
                    <telerik:RadButtonToggleState Value="Default" PrimaryIconCssClass="rbToggleCheckboxFilled"></telerik:RadButtonToggleState>
                    <telerik:RadButtonToggleState Value="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" Selected="true">    </telerik:RadButtonToggleState>
                </ToggleStates>
            </telerik:RadButton>
            </NodeTemplate>
            </telerik:RadTreeNode>
        </NodeTemplate>
    </telerik:RadTreeView>
<telerik:RadButton ID="Button1" runat="server" OnClick="Button1_Click" Text="Traverse the Tree"></telerik:RadButton>
<div class="module">
   <h2>You have selected the following items:</h2>
   <asp:Label ID="nodesClientside" runat="server" BorderStyle="None" CssClass="text"></asp:Label>
</div>

This has worked just fine so far for the functionality I need. Where I am running into a problem, is trying to manage changing parent checkboxes to match when all children or no children are selected. Obviously if a node has three children and it is selected then I want all the children to match the selected state. Likewise, if any one child node is selected I would like to get all sibling nodes, check if they are all the same state and set the parent node state appropriately.

However, Client Side when the OnClientCheckedChanged event fires for the RadButton within the Node, how do I pass the javascript a reference to the RadTreeNode that the RadButton is contained within? Or even on the backend if i call OnCheckedChanged from the RadButton embedded inside a RadTreeNode, is there a way I can get a reference to that node so that I can use get_parent.get_nodes() or traverse the TreeView to retrieve all sibling nodes for processing? 

I've pasted the complete code files below

Thanks.


Complete Front end ascx file code:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TreeView.ascx.cs" Inherits="DDW.TreeView" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <title>Telerik ASP.NET Example</title>
    <style type="text/css">
        .node-album
        {
            width: 186px;
            height: 35px;
            background: transparent url('images/album.png');
        }
 
        .node-album .band,
        .node-album .album
        {
            margin-left: 37px;
            display:block;
        }
 
        .node-album .band
        {
            font-size: 14px;
        }
        .node-album .album
        {
            color:#871fdf;
            font-size: 11px;
            line-height: 13px;
        }
        .node-album-data 
        {
            width:420px;
        }
        .node-album-data img
        {
            float:left;
            margin-top: 5px;
        }
        .node-album-data .album
        {
            font-size: 18px;
        }
        .node-album-data .album,
        .node-album-data .details
        {
            display:block;
            margin-left: 90px;
        }
 
        .node-album-data .details
        {
            margin-top: 10px;
            white-space:normal;
        }
        .RadTreeView_Default .rtHover span.rtIn
        {
            color: black !important;
            background:none !important;
            border: none !important;
            padding: 2px !important;
        }

        .RadTreeView_Default .rtSelected span.rtIn
        {
            color: black !important;
            background:none !important;
            border: none !important;
            padding: 2px !important;
        }
        .rtToggleCheckboxMixed {
            background: #CCC;
        }
    </style>
    <script type="text/javascript">
        function GetSiblings(textName) {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var node = tree.findNodeByText(textName);
            var allSiblingNotes = node.get_parent.get_nodes();
            for (var i = 0; i < allSiblingNotes.length; i++) {
                var node = allSiblingNotes[i];
                var CheckBox = node.findControl("RadButton1");
                alert(CheckBox.get_text());
            }
        }
    </script>
</head>
<body>
    <div class="demo-container size-medium">
            <telerik:RadTreeView runat="server" ID="RadTreeView1">
                <NodeTemplate>
                    <telerik:RadTreeNode Text="<%# DataBinder.Eval(Container.DataItem, "Name") %>">
                    <NodeTemplate>
                    <telerik:RadButton OnClientCheckedChanged="GetSiblings" ID="RadButton1" runat="server" ToggleType="CustomToggle" ButtonType="ToggleButton" AutoPostBack="false" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'>
                        <ToggleStates>
                            <telerik:RadButtonToggleState Value="Unchecked" PrimaryIconCssClass="rbToggleCheckbox"></telerik:RadButtonToggleState>
                            <telerik:RadButtonToggleState Value="Default" PrimaryIconCssClass="rbToggleCheckboxFilled"></telerik:RadButtonToggleState>
                            <telerik:RadButtonToggleState Value="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" Selected="true"></telerik:RadButtonToggleState>
                        </ToggleStates>
                    </telerik:RadButton>
                    </NodeTemplate>
                    </telerik:RadTreeNode>
                </NodeTemplate>
            </telerik:RadTreeView>
        <telerik:RadButton ID="Button1" runat="server" OnClick="Button1_Click" Text="Traverse the Tree"></telerik:RadButton>
        <div class="module">
           <h2>You have selected the following items:</h2>
           <asp:Label ID="nodesClientside" runat="server" BorderStyle="None" CssClass="text"></asp:Label>
        </div>

    </div>
</body>
</html>


Backend Code Complete:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;


namespace DDW
{
    public partial class TreeView : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadTreeView1.DataSource = GetAttributes();

                RadTreeView1.DataFieldID = "ID";
                RadTreeView1.DataFieldParentID = "ParentID";
                //attributesTree.DataTextField = "Name";

                RadTreeView1.DataBind();

            }
        }

        public List<Attribute> GetAttributes()
        {
            List<Attribute> attributesList = new List<Attribute>();

            attributesList.Add(new Attribute(1, null, "Attribute A", "Description for Attribute A", true, false, false));
            attributesList.Add(new Attribute(2, 1, "Attribute A1", "Description for Attribute A1", true, false, false));
            attributesList.Add(new Attribute(3, 1, "Attribute A2", "Description for Attribute A2", false, false, false));
            attributesList.Add(new Attribute(4, 1, "Attribute A3", "Description for Attribute A3", false, false, false));
            attributesList.Add(new Attribute(11, 4, "Attribute A3a", "Description for Attribute A3a", false, false, false));
            attributesList.Add(new Attribute(12, 4, "Attribute A3b", "Description for Attribute A3b", false, false, false));
            attributesList.Add(new Attribute(5, null, "Attribute B", "Description for Attribute B", true, false, true));
            attributesList.Add(new Attribute(6, 5, "Attribute B1", "Description for Attribute B1", true, false, true));
            attributesList.Add(new Attribute(7, 5, "Attribute B2", "Description for Attribute B2", false, false, false));
            attributesList.Add(new Attribute(8, null, "Attribute C", "Description for Attribute C", false, false, false));
            attributesList.Add(new Attribute(9, 8, "Attribute C1", "Description for Attribute C1", false, false, false));
            attributesList.Add(new Attribute(10, 8, "Attribute C2", "Description for Attribute C2", false, false, false));


            return attributesList;

        }
        public class Attribute
        {
            public int ID { get; set; }
            public int? ParentID { get; set; }
            public string Name { get; set; }
            public string Description { get; set; }
            public bool Include { get; set; }
            public bool Exclude { get; set; }
            public bool Default { get; set; }

            public Attribute()
            {

            }

            public Attribute(int id, int? parentID, string name, string description, bool def, bool include, bool exclude)
            {
                ID = id;
                ParentID = parentID;
                Name = name;
                Description = description;
                Default = def;
                Include = include;
                Exclude = exclude;
            }

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            ShowCheckedNodes(RadTreeView1, nodesClientside);
        }
        private static void ShowCheckedNodes(RadTreeView treeView, Label label)
        {
            string message = string.Empty;
            foreach (RadTreeNode node in treeView.GetAllNodes())
            {
                RadButton CheckBoxState = (RadButton)node.FindControl("RadButton1");
                message += CheckBoxState.Text + ": " + CheckBoxState.ToggleStates[CheckBoxState.SelectedToggleStateIndex].Value + "<br/>";

            }
            label.Text = message;
        }
    }
}











Dimitar
Telerik team
 answered on 20 Mar 2015
2 answers
55 views
Hi,

I've been trying to link to RadTimePicker together, so when i change the time of one of them the time is adjust properly. I only have a problem and i don't know if its possible to do something about it.

When i change the time to of the first time picker, the result is the time selected should be on the next day.

eg. I select 23h30 on today and the result i want is 00h00 on the next day.

I does change the time on the second RadTimePicker, but it always stays as today.

My question is, is there a way to change the date to the RadTimePicker? I know that there's a RadDateTimePicker but i can't use this control on the page i have right now.

Thx for your help,

Guillaume
Guillaume
Top achievements
Rank 1
 answered on 20 Mar 2015
7 answers
234 views
I have notice a new problem that I cannot account for.  I have several development boxes.  Two of the three operate using VM's and the third is a honest to god developer box.  On one of those systems the "3rd party" toolbox components are all missing their icons.  By this I mean that all the telerik components appear in the toolbox however non of them have any icon next to  them.   This makes it difficult to find a "radgrid" component and so on.  Everything works however visually it is difficult to quickly find things.  

Programs written previously, or those constructed "today" function without error.  That is to say all the Telerik components appear in the toolbox (albeit without icons), and can be dragged into your program and used in the traditional manner.  Programs compile and deploy without any challenges.

In an effort to resolve this problem I have uninstalled the telerik suite of tools completely.  I have rebooted the box.  I then ran a repair on Visual Studio.  I launched the VS tool using Admin rights and allowed it to reset the toolbox as part of its "initial" load of the studio product.  I then reloaded all the Telerik products and attempted to write a simple "do nothing" program.  As before the toolbox shows all the components however nothing has any icons.

I have tried everything short of nuking everything and starting over.  The only idea I can remotely account for this (and I do not believe this) is that this particular box (and no others) has had a virtual machine run upon it which contained WIndows 10 and Visual Studio 2015.  Notice I said the same physical hardware however different VM's.  Is it possible that I am encountering a "sync" problem where a "cloud" service has settings (from my VS 2015 instance) and they are attempting to merge with my VS 2013 version?  I know TELERIK has a sync of settings option as well as Microsofts Team Foundation server (which I use) also syncs settings.  Again while I am using a different VM, i am on the same physical hardware and same logins.
 
Anyone have any bright ideas for me to try?  Has anyone seen this problem?  I hate to wipe the box entirely to solve an icon problem.


Yana
Telerik team
 answered on 20 Mar 2015
1 answer
165 views
Hi,
I have a telerik radgrid in my page and one of the columns has rad combobox.After I select some value in combobox if page post back happens combo box selected value is not retained.Please help.

Thanks & Regards
Himagiri
Eyup
Telerik team
 answered on 20 Mar 2015
1 answer
131 views
Hi Telerik

I have an issue about drag and drop. I can not drag and drop a record when zooming web. The DestDatItem is null. Thanks

Pavlina
Telerik team
 answered on 20 Mar 2015
1 answer
304 views
I'm trying to display images from another server path using ImageGallery example below: (actually code with read from database loop)  anyway, if I put the images in the wwwroot folder path it works "~\images\" but when I point to a physical path it doesn't.

Protected Sub RadImageGallery1_NeedDataSource(sender As Object, e As Telerik.Web.UI.ImageGalleryNeedDataSourceEventArgs) Handles RadImageGallery1.NeedDataSource
TryCast(sender, RadImageGallery).DataSource = GetImageGalleryData()
End Sub

Private Function GetImageGalleryData() As DataTable
Dim table As New DataTable()
table.Columns.Add("Title", GetType(String))
table.Columns.Add("Description", GetType(String))
table.Columns.Add("ImageData", GetType(String))

table.Rows.Add("Image 1", "Description", "c:\images\Bale-0301201638060.jpg")
table.Rows.Add("Image 2", "Description", "c:\images\Bale-0301201638060.jpg")

Return table
End Function


Konstantin Dikov
Telerik team
 answered on 20 Mar 2015
1 answer
61 views
Hi

Not necessarily a problem with the control, just asking if this problem has a solution.

I have a Radwindow that pops up modally and plays a YouTube video, trouble is when I close the window the content continues playing.

Can this be prevented?

Andy
Marin Bratanov
Telerik team
 answered on 20 Mar 2015
1 answer
101 views
I need to determine the row that a control is on the client side.

Anyone have an example that I can use?

Thanks
Eyup
Telerik team
 answered on 20 Mar 2015
1 answer
161 views
Dear All,

I am going mad with what looks to me as a silly thing; I get a "Selection out of range" Parameter name: value error on a page when I try to set the filter to a value that does not exist in the dropdown combo (see printscreen attached).

I am looking for a solution to avoid/catch this error. I cannot avoid people to filter for non-existing values so I need to catch this error and handle it properly but I don't know how... Can someone help ? The code of the page is as below:

<%@ Page Title="List of WoWs" Language="VB" MasterPageFile="~/wowsearch.master" AutoEventWireup="false" CodeFile="WoWlist.aspx.vb" Inherits="WoWlist" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>R&D Campus WoWs List</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="qckSwitch" Runat="Server">
    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/WoWsearch.aspx">switch to search tool</asp:HyperLink>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cntBody" Runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            //<![CDATA[
            var RadGrid1;
            var lnkShareFilter;
 
            lnkShareFilter = '';
 
            function GetGridObject(sender, eventArgs) {
                RadGrid1 = sender;
            }
 
            function ExportToExcel(fileName)
            {
                RadGrid1.get_masterTableView().exportToExcel(fileName);
            }
 
            //]]>
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="False" CellSpacing="0"
        DataSourceID="sqlWoWList" GridLines="None" PageSize="20" EnableLinqExpressions="false" Width="100%" Height="100%">
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            <ClientEvents OnGridCreated="GetGridObject"></ClientEvents>
        </ClientSettings>
        <ExportSettings ExportOnlyData="true" FileName="List of WoWs" HideStructureColumns="true" IgnorePaging="true" >
            <Excel Format="ExcelML" />
        </ExportSettings>
        <MasterTableView AutoGenerateColumns="False" DataSourceID="sqlWoWList" CommandItemDisplay="Top">
 
            <NoRecordsTemplate>
                <table width="100%" border="0" cellpadding="20" cellspacing="20">
                    <tr>
                        <td align="center">
                            <h2 style="color:Red">No WoWs or SOPs found.<br />Please change or reset the filter.</h2>
                        </td>
                    </tr>
                </table>
            </NoRecordsTemplate>
 
            <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
            <CommandItemTemplate>
                <div id="cmdContainer" style="width: 99%; padding: 10px; text-align: right;">
                    <a href="http://teamroom.nestle.com/GLOBEISIT/PTCOrbeBPMAcademy/Induction ; Training Materials/Training and Quick Reference Materials/Campus Search QRC.pdf" target="_blank" style="padding: 5px; border: 1px solid gray; margin: 0px 5px;">
                        <img src="../App_Themes/OneRDCampus/images/question-white.png" style="border: none; vertical-align: text-bottom;" /> How To
                    </a>
                    <a href="WoWlist.aspx" style="padding: 5px; border: 1px solid gray; margin: 0px 5px;">
                        <img src="../App_Themes/OneRDCampus/images/filter_(delete)_16x16.gif" style="border: none; vertical-align: text-bottom;" /> Reset filters
                    </a>
                    <a id="lnkShareFilter" onserverclick="lnkShareFilter_ServerClick" href="#" runat="server" style="padding: 5px; border: 1px solid gray; margin: 0px 5px;">
                        <img src="../App_Themes/OneRDCampus/images/bpm_email.png" style="border: none; vertical-align: text-bottom;" /> Share filter
                    </a>
                    <a href="#" runat="server" onclick="ExportToExcel('WoWlist');" style="padding: 5px; border: 1px solid gray; margin: 0px 5px;">
                        <img src="../App_Themes/OneRDCampus/images/Export2XL.gif" style="border: none; vertical-align: text-bottom;" /> Export to excel
                    </a>
                </div>
            </CommandItemTemplate>
 
            <Columns>
                <telerik:GridTemplateColumn DataField="Title" CurrentFilterFunction="NoFilter" HeaderText="Title" HeaderTooltip="Title of the WoW or document (roll-over to display the purpose)"
                    SortExpression="Title" UniqueName="Title" FilterControlAltText="Filter Title Column" FilterListOptions="AllowAllFilters" AutoPostBackOnFilter="true"
                    ShowFilterIcon="false" FilterControlWidth="100%">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%#Eval("myURL")%>' ToolTip='<%#Eval("Purpose")%>' Target='<%#Eval("URLTarget")%>'><%#Eval("Title")%></asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="DiagramOwner" CurrentFilterFunction="NoFilter" FilterControlAltText="Filter DiagramOwner column" HeaderText="Owner" ReadOnly="True" SortExpression="DiagramOwner" UniqueName="DiagramOwner"
                        AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="100%" HeaderTooltip="Owner of the WoW or document">
                    <HeaderStyle Width="130px" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Unit" CurrentFilterFunction="NoFilter" FilterControlAltText="Filter Unit column" HeaderText="Unit"
                    SortExpression="Unit" UniqueName="Unit" HeaderTooltip="Unit that the WoW or document belongs to">
                    <HeaderStyle Width="120px" />
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxUnit" runat="server" MaxHeight="200px" Width="110px" DropDownWidth="130px"
                            DataSourceID="sqlUnits" DataTextField="Unit" DataValueField="Unit" AppendDataBoundItems="true"
                            SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Unit").CurrentFilterValue%>'
                            OnClientSelectedIndexChanged="UnitIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
 
                        <telerik:RadScriptBlock ID="RadScriptBlock4" runat="server">
                            <script type="text/javascript">
                                function UnitIndexChanged(sender, args) {
                                    var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>");
                                    tableView.filter("Unit", args.get_item().get_value(), "Contains");
                                    lnkShareFilter &= '&Unit=' & args.get_item().get_value();
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Type" CurrentFilterFunction="NoFilter" FilterControlAltText="Filter Type column" HeaderText="Type"
                    SortExpression="Type" UniqueName="Type" FilterControlWidth="50px" HeaderTooltip="Type of WoW or document">
                    <HeaderStyle Width="90px" />
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxType" runat="server" Width="80px" DropDownWidth="130px"
                            DataSourceID="sqlTypes" DataTextField="Type" DataValueField="Type" AppendDataBoundItems="true"
                            SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Type").CurrentFilterValue%>'
                            OnClientSelectedIndexChanged="TypeIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
 
                        <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
                            <script type="text/javascript">
                                function TypeIndexChanged(sender, args) {
                                    var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>");
                                    tableView.filter("Type", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Building" CurrentFilterFunction="NoFilter" FilterControlAltText="Filter by Group" HeaderText="Building/Group"
                    SortExpression="Building" UniqueName="Building" HeaderTooltip="Campus Building or other local grouping" >
                    <HeaderStyle Width="120px"  />
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxBuilding" runat="server" MaxHeight="200px" Width="110px" DropDownWidth="160px"
                            DataSourceID="sqlBuildings" DataTextField="Building" DataValueField="Building" AppendDataBoundItems="true"
                            SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Building").CurrentFilterValue%>'
                            OnClientSelectedIndexChanged="BuildingIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
 
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                            <script type="text/javascript">
                                function BuildingIndexChanged(sender, args) {
                                    var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>");
                                    tableView.filter("Building", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Room" CurrentFilterFunction="NoFilter" FilterControlAltText="Filter Sub-Grouping column" HeaderText="Room/Sub-Group"
                    SortExpression="Room" UniqueName="Room" HeaderTooltip="Campus Room or other local sub-grouping">
                    <HeaderStyle Width="140px" />
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxRoom" runat="server" MaxHeight="200px" Width="130px" DropDownWidth="260px"
                            DataSourceID="sqlRooms" DataTextField="Room" DataValueField="Room" AppendDataBoundItems="true"
                            SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Room").CurrentFilterValue%>'
                            OnClientSelectedIndexChanged="RoomIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
 
                        <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                            <script type="text/javascript">
                                function RoomIndexChanged(sender, args) {
                                    var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>");
                                    tableView.filter("Room", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="IsReleased" FilterControlAltText="Filter IsReleased column" HeaderText="Released" SortExpression="IsReleased"
                    UniqueName="IsReleased" HeaderTooltip="Is the WoW or document released and publically available?">
                    <HeaderStyle Width="55px" />
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxIsReleased" runat="server" Width="42px" DropDownAutoWidth="Enabled"
                            SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("IsReleased").CurrentFilterValue%>'
                            OnClientSelectedIndexChanged="IsReleasedIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                                <telerik:RadComboBoxItem Text="Yes" Value="Yes" />
                                <telerik:RadComboBoxItem Text="No" Value="No" />
                            </Items>
                        </telerik:RadComboBox>
 
                        <telerik:RadScriptBlock ID="RadScriptBlock5" runat="server">
                            <script type="text/javascript">
                                function IsReleasedIndexChanged(sender, args) {
                                    var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>");
                                    tableView.filter("IsReleased", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="NQMSRelated" CurrentFilterFunction="NoFilter" FilterControlAltText="Filter NIMS column" HeaderText="Compliance"
                    SortExpression="NQMSRelated"" UniqueName="NQMSRelated" HeaderTooltip="Is the WoW or document subject to Compliance?">
                    <HeaderStyle Width="50px" />
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxNQMSRelated" runat="server" Width="42px" DropDownAutoWidth="Enabled"
                            SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("NQMSRelated").CurrentFilterValue%>'
                            OnClientSelectedIndexChanged="NQMSRelatedIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                                <telerik:RadComboBoxItem Text="Yes" Value="Yes" />
                                <telerik:RadComboBoxItem Text="No" Value="No" />
                            </Items>
                        </telerik:RadComboBox>
 
                        <telerik:RadScriptBlock ID="RadScriptBlock6" runat="server">
                            <script type="text/javascript">
                                function NQMSRelatedIndexChanged(sender, args) {
                                    var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>");
                                    tableView.filter("NQMSRelated", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <GroupingSettings CaseSensitive="false" />
    </telerik:RadGrid>
    <asp:SqlDataSource ID="sqlUnits" runat="server" ConnectionString="<%$ ConnectionStrings:Hydra_DevConnectionString %>"
        SelectCommand="SELECT DISTINCT [Unit] FROM [WoW_VWR_Trackers] WHERE [Unit] IS NOT NULL ORDER BY [Unit]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sqlTypes" runat="server" ConnectionString="<%$ ConnectionStrings:Hydra_DevConnectionString %>"
        SelectCommand="SELECT DISTINCT [Type] FROM [WoW_VWR_Trackers] ORDER BY [Type]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sqlBuildings" runat="server" ConnectionString="<%$ ConnectionStrings:Hydra_DevConnectionString %>"
        SelectCommand="SELECT DISTINCT [Building] FROM [WoW_VWR_Trackers] WHERE [Building] IS NOT NULL ORDER BY [Building]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sqlRooms" runat="server" ConnectionString="<%$ ConnectionStrings:Hydra_DevConnectionString %>"
        SelectCommand="SELECT DISTINCT [Room] FROM [WoW_VWR_Trackers] WHERE [Room] IS NOT NULL ORDER BY [Room]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sqlWoWList" runat="server" ConnectionString="<%$ ConnectionStrings:Hydra_DevConnectionString %>"
        SelectCommand="SELECT DiagramURL AS myURL, * FROM [Hydra_Dev].[dbo].[WoW_VWR_Trackers]">
    </asp:SqlDataSource>
</asp:Content>

And the code-behind:
Imports Telerik.Web.UI
Imports System.Diagnostics
Imports System.Collections.Specialized.NameObjectCollectionBase
Imports System.Net
Imports System.IO
 
Imports System.Net.Mail
 
 
Partial Class WoWlist
    Inherits System.Web.UI.Page
 
    Const lvlVerboseNone As Integer = 0
    Const lvlVerboseSilent As Integer = 1
    Const lvlVerboseMail As Integer = 2
    Const lvlVerboseScreen As Integer = 4
 
    Const lvlVerbose As Integer = lvlVerboseSilent
 
    Dim ShareFilter As Object
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim IsDataSyncd As Boolean = CheckDataSync()
        If lvlVerbose = lvlVerboseMail Then
            SendChkMail()
        End If
 
        If Not IsDataSyncd Then
            'Launch DataSync
        End If
 
        If Not IsPostBack Then
            If Request.QueryString("Title") IsNot Nothing Then
                Dim myTitle As String = Server.UrlDecode(Request.QueryString("Title").ToString)
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(Title LIKE '" & myTitle & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Title")
                radColumn.CurrentFilterValue = myTitle
                radColumn.CurrentFilterFunction = GridKnownFunction.Contains
            End If
            If Request.QueryString("Owner") IsNot Nothing Then
                Dim myOwner As String = Server.UrlDecode(Request.QueryString("Owner").ToString)
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(DiagramOwner LIKE '" & myOwner & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("DiagramOwner")
                radColumn.CurrentFilterValue = myOwner
                radColumn.CurrentFilterFunction = GridKnownFunction.Contains
            End If
            If Request.QueryString("Building") IsNot Nothing Then
                Dim myBuilding As String = Server.UrlDecode(Request.QueryString("Building").ToString)
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(Building LIKE '" & myBuilding & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Building")
                radColumn.CurrentFilterValue = myBuilding
                radColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
            End If
            If Request.QueryString("Unit") IsNot Nothing Then
                Dim myUnit As String = Server.UrlDecode(Request.QueryString("Unit").ToString)
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(Unit LIKE '" & myUnit & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Unit")
                radColumn.CurrentFilterValue = myUnit
                radColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
            End If
            If Request.QueryString("Room") IsNot Nothing Then
                Dim myRoom As String = Server.UrlDecode(Request.QueryString("Room").ToString)
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(Room LIKE '" & myRoom & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Room")
                radColumn.CurrentFilterValue = myRoom
                radColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
            End If
            If Request.QueryString("Type") IsNot Nothing Then
                Dim myType As String = Server.UrlDecode(Request.QueryString("Type").ToString)
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(Type LIKE '" & myType & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Type")
                radColumn.CurrentFilterValue = myType
                radColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
            End If
            If Request.QueryString("Owner") IsNot Nothing Then
                Dim myOwner As String = Server.UrlDecode(Request.QueryString("Owner").ToString)
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(DiagramOwner LIKE '" & myOwner & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("DiagramOwner")
                radColumn.CurrentFilterValue = myOwner
                radColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
            End If
            If Request.QueryString("IsReleased") IsNot Nothing Then
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(IsReleased LIKE '" & Request.QueryString("IsReleased").ToString & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("IsReleased")
                radColumn.CurrentFilterValue = Request.QueryString("IsReleased").ToString
                radColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
            Else
                If Request.QueryString("IsReleased") Is Nothing And Request.QueryString("Owner") Is Nothing And Request.QueryString("Type") Is Nothing And Request.QueryString("Room") Is Nothing And Request.QueryString("Unit") Is Nothing Then
                    If RadGrid1.MasterTableView.FilterExpression <> "" Then
                        RadGrid1.MasterTableView.FilterExpression &= " AND "
                    End If
                    RadGrid1.MasterTableView.FilterExpression &= "(IsReleased LIKE 'Yes')"
                    Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("IsReleased")
                    radColumn.CurrentFilterValue = "Yes"
                    radColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
                End If
            End If
            If Request.QueryString("NQMSRelated") IsNot Nothing Then
                If RadGrid1.MasterTableView.FilterExpression <> "" Then
                    RadGrid1.MasterTableView.FilterExpression &= " AND "
                End If
                RadGrid1.MasterTableView.FilterExpression &= "(NQMSRelated LIKE '" & Request.QueryString("NQMSRelated").ToString & "')"
                Dim radColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("NQMSRelated")
                radColumn.CurrentFilterValue = Request.QueryString("NQMSRelated").ToString
                radColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
            End If
            'RadGrid1.MasterTableView.Rebind()
        End If
        ' FilterExpression="([IsReleased] LIKE 'Yes')"
    End Sub
 
    Private Function CheckDataSync() As Boolean
        Return True
    End Function
 
    Private Function SendChkMail() As Boolean
        Return False
    End Function
 
    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    End Sub
 
    Private Sub RadGrid1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.Load
    End Sub
 
    Private Sub RadGrid1_PreInit(ByVal sender As Object, ByVal e As System.EventArgs)
        For Each item As GridColumn In RadGrid1.MasterTableView.Columns
            Dim FilterFunction As String = item.CurrentFilterFunction.ToString
            Dim FilterValue As String = item.CurrentFilterValue.ToString
            Dim FilterColumn As String = item.UniqueName.ToString
 
            If FilterFunction <> "NoFilter" Then
                If item.CurrentFilterValue.ToString() = "" Then
                    item.ItemStyle.BackColor = RadGrid1.AlternatingItemStyle.BackColor
                Else
                    item.ItemStyle.BackColor = Drawing.Color.LightYellow
                End If
            End If
 
        Next
    End Sub
 
    Protected Sub RadGrid1_PreRender(ByVal source As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender
        If Not RadGrid1.MasterTableView.FilterExpression Is String.Empty Then
            RefreshCombos()
        End If
 
        For Each item As GridColumn In RadGrid1.MasterTableView.Columns
            Dim FilterFunction As String = item.CurrentFilterFunction.ToString
            Dim FilterValue As String = item.CurrentFilterValue.ToString
            Dim FilterColumn As String = item.UniqueName.ToString
 
            If FilterFunction <> "NoFilter" Then
                If item.CurrentFilterValue.ToString() = "" Then
                    item.ItemStyle.BackColor = RadGrid1.AlternatingItemStyle.BackColor
                Else
                    item.ItemStyle.BackColor = Drawing.Color.LightYellow
                End If
            End If
 
        Next
    End Sub
 
    Protected Sub RefreshCombos()
        sqlBuildings.SelectCommand = AddFilterParameters(sqlBuildings.SelectCommand, RadGrid1.MasterTableView.FilterExpression.ToString())
        sqlRooms.SelectCommand = AddFilterParameters(sqlRooms.SelectCommand, RadGrid1.MasterTableView.FilterExpression.ToString())
 
        sqlTypes.SelectCommand = AddFilterParameters(sqlTypes.SelectCommand, RadGrid1.MasterTableView.FilterExpression.ToString())
 
        sqlUnits.SelectCommand = AddFilterParameters(sqlUnits.SelectCommand, RadGrid1.MasterTableView.FilterExpression.ToString())
        RadGrid1.MasterTableView.Rebind()
    End Sub
 
    Private Function AddFilterParameters(ByVal sqlSelect As String, FilterExpression As String) As String
        Dim posORDER As Int16 = 0
        posORDER = InStr(sqlSelect, "ORDER BY", CompareMethod.Text) - 1
        Dim sqlOrder As String = Right(sqlSelect, Len(sqlSelect) - posORDER)
 
        Dim posWHERE As Int16 = 0
        posWHERE = InStr(sqlSelect, "WHERE", CompareMethod.Text) - 2
 
        Dim sqlCommand As String = ""
        If posWHERE < 0 Then
            sqlCommand = Left(sqlSelect, posORDER)
        Else
            sqlCommand = Left(sqlSelect, posWHERE)
        End If
 
        Dim sqlFilter As String = ""
        If posWHERE > 2 Then
            sqlFilter = Mid(sqlSelect, posWHERE + 8, posORDER - posWHERE - 8)
        End If
 
        If sqlFilter.Length > 0 Then
            If Left(FilterExpression, 5) <> " AND " Then
                sqlFilter &= " AND "
            End If
        End If
        sqlFilter &= FilterExpression
 
        sqlCommand &= " WHERE " & sqlFilter
 
        Return sqlCommand
    End Function
 
    Private Sub RadGrid1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.Init
        Dim menu As GridFilterMenu = RadGrid1.FilterMenu
        Dim i As Integer = 0
        While i < menu.Items.Count
            If menu.Items(i).Text = "NoFilter" Or _
               menu.Items(i).Text = "Contains" Or _
               menu.Items(i).Text = "EqualTo" Then
                i = i + 1
            Else
                menu.Items.RemoveAt(i)
            End If
        End While
    End Sub
 
    Private Sub RadGrid1_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        If e.CommandName = RadGrid.FilterCommandName Then
            Dim objFilterPair As Pair = CType(e.CommandArgument, Pair)
            Dim objCol As GridColumn = CType(e.Item.OwnerTableView.GetColumn(objFilterPair.Second.ToString()), GridColumn)
 
            Debug.Print("[" & objFilterPair.First.ToString & "]:[" & objFilterPair.Second.ToString & "] = [" & objCol.CurrentFilterValue.ToString() & "]")
 
            If objCol.CurrentFilterValue.ToString() = "" Then
                objCol.ItemStyle.BackColor = RadGrid1.AlternatingItemStyle.BackColor
            Else
                objCol.ItemStyle.BackColor = Drawing.Color.LightYellow
            End If
 
        End If
    End Sub
 
    Protected Sub lnkShareFilter_ServerClick(sender As Object, e As EventArgs)
        Dim lnkFilter As String = String.Empty
 
        For Each item As GridColumn In RadGrid1.MasterTableView.Columns
            Dim FilterFunction As String = item.CurrentFilterFunction.ToString
            Dim FilterValue As String = item.CurrentFilterValue.ToString
            Dim FilterColumn As String = item.UniqueName.ToString
 
            If FilterFunction <> "NoFilter" Then
                Debug.Print(FilterColumn & ":" & FilterFunction & "=" & FilterValue)
                lnkFilter &= "&" & FilterColumn & "=" & Server.UrlEncode(FilterValue)
            End If
 
        Next
 
        lnkFilter = "mailto:&subject=WoW List&body=" & Server.UrlEncode("http://chorra0004/hydra/bpm/WoWList.aspx?" & lnkFilter.Substring(1))
 
        Debug.Print("[" & lnkFilter & "]")
        ClientScript.RegisterStartupScript(Me.GetType(), "mailto", "<script type = 'text/javascript'>parent.location='" & lnkFilter & "'</script>")
    End Sub
 
    Protected Function ContentExists(ByVal strUrl As String) As Boolean
        Try
            Dim hwrRequest As HttpWebRequest = WebRequest.Create(strUrl)
            Dim hwrResponse As HttpWebResponse = hwrRequest.GetResponse()
            Dim stmStream As Stream = hwrResponse.GetResponseStream()
            Dim strReader As String = New StreamReader(stmStream).ReadToEnd()
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function
 
    Protected Function urlExists(ByVal strUrl As String) As Boolean
        Try
            Dim hwrRequest As HttpWebRequest = WebRequest.Create(strUrl)
            hwrRequest.AllowAutoRedirect = False
            Dim hwrResponse As HttpWebResponse = hwrRequest.GetResponse()
            If hwrResponse.StatusCode = HttpStatusCode.OK Then
                Return True
            Else
                Return False
            End If
        Catch ex As Exception
            Return False
        End Try
    End Function
End Class

Error occurs in Page_Load sub.



Eyup
Telerik team
 answered on 20 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?