Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7024187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:48:29+00:00 2026-05-27T23:48:29+00:00

I’m trying to achieve something which I’m sure is pretty simple but I cannot

  • 0

I’m trying to achieve something which I’m sure is pretty simple but I cannot see the wood for the trees. I have created a simple control which inherits from link button which contains a list of a simple object called LinkParamaters, the idea being that in markup you can define a postback url as well as parameters which then returns the PostBackUrl property to include a querystring. This was working as expected until I wanted to data bind the parameters within a repeater. I then started to get the following Parser Error:

Databinding expressions are only supported on objects that have a DataBinding event. UI.Controls.LinkParameter does not have a DataBinding event.

So I figured I obviously needed to implement a data bind event. maybe there is an interface I need to implement, I couldn’t find one. Sadly I’ve just moved jobs so don’t have access to reflector at the moment so could not drill down into the code but I could see that Control has these events/methods, inheriting the parameter object from Control solved the parser error but unsurprisingly didn’t resolve the binding and it doesn’t make sense anyway as it’s not a control.

The Link button code :

[ParseChildren(true, DefaultProperty = "Parameters")]
public class QueryLinkButton : LinkButton
{

    private String _url = null;

    public QueryLinkButton()
    {
        this.Parameters = new List<LinkParameter>();
    }

    public override String PostBackUrl
    {
        get
        {
            return _url ?? (_url = BuildUrl());
        }
        set
        {
            base.PostBackUrl = value;
        }
    }

    [PersistenceMode(PersistenceMode.InnerDefaultProperty)]
    public List<LinkParameter> Parameters { get; set; }

    private String BuildUrl()
    {
        //Build URL to Include Query String Params           
    }

}

public class LinkParameter 
{

    public String Name { get; set; }

    public String Value { get; set; }

}

And then the Asp Code :

 <custom:QueryLinkButton runat="server" ID="EventLink" Text="View Accommodation" PostBackUrl="HotelCriteria.aspx">
       <custom:LinkParameter runat="server" Name="EventID" Value='<%# Eval("EventID")%>'/>
  </custom:QueryLinkButton>

I’ve got around the problem for now by handling this server side but it really kind of negates what I was trying to do creating the custom control as I wanted to define these things purely in the mark-up. Even just a link to an article to get me started will be much appreciated as I’ve googled for so long and could only find similar problems but not the same thing but that is most likely to poor search criteria.

Thanks in advance

Paul

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:48:29+00:00Added an answer on May 27, 2026 at 11:48 pm

    I managed to fix this in the end by using my brain, I’m not 100% confident it is the ideal solution but it does make sense to me and more importantly this silly little problem is now working :0).

    I got my LinkParameter class to derive from DataBoundControl and then overrode the DataBind method on the custom control and then told each parameter to perform it’s DataBind method:

        public override void DataBind()
        {
            base.DataBind();
            foreach (LinkParameter param in Parameters)
            {
                param.DataBind();
            }
        }
    

    If anyone has a cleaner, more efficient solution then please let me know.

    Thanks

    Paul

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I am trying to understand how to use SyndicationItem to display feed which is
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.