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 7183653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:01:58+00:00 2026-05-28T18:01:58+00:00

ASP Declaration: <asp:LinkButton ID=LinkButton1 runat=server Text=edit item onclick=’AddItem.aspx?catid=<%# Eval(CollectionID)%>’></asp:LinkButton> I get Error: The server

  • 0

ASP Declaration:

 <asp:LinkButton ID="LinkButton1" runat="server" Text="edit item" onclick="'AddItem.aspx?catid=<%# Eval("CollectionID")%>'"></asp:LinkButton>

I get Error:
The server tag is not well formed.

what the problem with LinkButton decloration?
Thank you in advance.

  • 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-28T18:02:01+00:00Added an answer on May 28, 2026 at 6:02 pm
    <asp:LinkButton ID="LinkButton1" runat="server" Text="edit item" onclick='AddItem.aspx?catid=<%# Eval("CollectionID")%>' />
    

    I removed extraneous quotes around the attribute value for OnClick.

    However, OnClick expects a delegate, not a URL. Either use a hyperlink or switch to an event handler.

    <a href='AddItem.aspx?catid=<%# Eval("CollectionID")%>'>edit item</a>
    

    This article shows how to pass an argument to an event handler from a link button. Instead of using OnClick, you can use OnCommand and set the CommandArgument property.

    In Markup

      <asp:LinkButton id="lnkEdit" 
           Text="Edit Item"
           CommandArgument='<%# Eval("CollectionID")%>'
           OnCommand="lnkEdit_Command" 
           runat="server"/>
    

    In Codebehind

    protected void lnkEdit_Command( object sender, CommandEventArgs e )
    {
        // evaluate e.CommandArgument and do something with it
    }
    

    I favor using a URL versus a command event handler whenever possible as it eliminates a comparatively expensive postback.

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

Sidebar

Related Questions

Using ASP MVC and Entity Framework. In the view, you have a page declaration
ASP.NET server-side controls postback to their own page. This makes cases where you want
ASP.NET 1.1 - I have a DataGrid on an ASPX page that is databound
ASP.Net: In code-behind I can simulate <%# Eval(Property)%> with a call to DataBinder.Eval(myObject,Property); How
Given an ASP.NET MVC Controller class declaration: public class ItemController : Controller { public
As I'm working on a asp.net/c# project, I'm confronted with the foobar.aspx.designer.cs that auto
I'm going to simplify my route declaration around of my asp.net mvc project. So
I am using ASP.NET resource internationalization. I have the following structure /App_LocalResources Default.aspx.resx /App_GlobalResources
I'm am creating an ASP.NET 2.0 web application that uses a BasePage.aspx that is
In Asp.Net MVC 2.0, at least in the beta, you could decoration your model

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.