Question: I've seen a few pages on the net regarding this, but unfortunately the sample code is in C#. I can't make sense of most of it (and/or run it through a code translator) but I still need help making it work in VB.

My custom function is:

```
Public Shared Function GetFriendlyTitle(Title As String) As String
    Dim ConvertedTitle As String = ""
    Try
        Dim oRE As Regex = New Regex("[^a-zA-Z0-9\s]")
        ConvertedTitle = Trim(oRE.Replace(Title, "")).Replace(" ", "_")
    Catch ex As Exception
        LogError(ex)
    End Try
    Return ConvertedTitle
End Function 

```

and here's the function I'm calling to return products:

```
Public Shared Function GetProductByTypeAndTitle(URLFriendlyTitle As String, ProductType As ProductType)
    Try
        'don't know why, but the server threw errors if I went c.Type=Type
        Dim pt As Integer = CInt([Enum].Parse(GetType(ProductType), [Enum].GetName(GetType(ProductType), ProductType)))

        Dim context As LionsSharePressEntities = New LionsSharePressModel.LionsSharePressEntities
        return From p In context.Products Where GetFriendlyTitle(p.Title) = URLFriendlyTitle AndAlso p.Type = pt
    Catch ex As Exception
        LogError(ex)
        Return nothing
    End Try
End Function 

```

It compiles fine, but hangs when I run it. It's that return line that does it.

Answer: 
can you try add custom attribute like this

```
protected void repeaterCategories_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {
        CheckBox chk = e.Item.FindControl("chbCategoria") as CheckBox ;
        chk.Attributes.Add("PageID", DataBinder.Eval(e.Item.DataItem, "DB_FIELD").ToString());
    }
}

```
User control page:

```
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<asp:CheckBox id ="MyCheckBox" runat="server"/>

```

Code behind:

```
using System;

public partial class WebUserControl : System.Web.UI.UserControl
{
    private string _myProperty;
    public string MyProperty 
    {
        get { return this._myProperty; }
        set { this._myProperty = value; }
    }

    public bool IsChecked
    {
        get 
        {
            return this.MyCheckBox.Checked;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
}

```

At your repeater page:

```
<%@ Register Src="~/WebUserControl.ascx" TagPrefix="uc1" TagName="WebUserControl" %>

```

Inside the repeater:

```
<asp:Repeater id="repeaterCategories" runat="server">
    <ItemTemplate>
        ...

        <uc1:WebUserControl runat="server" ID="WebUserControl" MyProperty="My_ID_Value" />

        ...
    </ItemTemplate>
</asp:Repeater>

```

You can add as many properties you like on your web user control.