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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:50:44+00:00 2026-06-08T00:50:44+00:00

i am writing some adding some link attribute like below. which render to HTML,

  • 0

i am writing some adding some link attribute like below.
which render to HTML, but i want to knwo i can i acess those attributes value at button click event?

My code is below

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem gridDataItem = (GridDataItem)e.Item;
        gridDataItem.Height = Unit.Pixel(10);
        HyperLink link = (HyperLink)gridDataItem["ContentTitle"].Controls[0];
        ViewState["ContentID"] = gridDataItem["ContentID"].Text;
        link.ForeColor = System.Drawing.Color.Navy;
        link.ToolTip = Common.grdTextCell(gridDataItem["ContentSummaryDescr"].Text);
        link.NavigateUrl = "~/SlideImages/" + gridDataItem["ContentName"].Text;//Session["contentFolderPath"] + "\\"+ gridDataItem["ContentName"].Text;// Common.grdTextCell(gridDataItem["ContentName"].Text);
        link.Target = "_blank";
        link.Attributes["name"] = gridDataItem["ContentID"].Text + "," + gridDataItem["SiteContentListID"].Text;
        HttpResponse myHttpResponse = Response;
        HtmlTextWriter myHtmlTextWriter = new HtmlTextWriter(myHttpResponse.Output);
        link.Attributes.AddAttributes(myHtmlTextWriter);
        link.Attributes.Add("onclick",
        "document.getElementById('" +
            dummyBtn.ClientID + "').click();");
    }
}

protected void dummyBtn_Click(object sender, EventArgs e)
{


}

rendered HTML is like this..

I am writing this for one row

<td><a style="color:Navy;" target="_blank" href="somepath/abc.doc" onclick="document.getElementById('MainContent_SiteNewCon_dummyBtn').click();" name="1,16" title="rupesh tesr">test</a></td>

i want to use thses name=”1, 16″ to my button click event so that i can save them to db.

  • 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-06-08T00:50:46+00:00Added an answer on June 8, 2026 at 12:50 am

    Yes you can using jQuery. For example,

       $("MyLink").click=(function(){
            alert( $("MyLink").attr("title"));//For getting title value.
        });
    

    Add id="MyLink" to your link

    <a style="color:Navy;" target="_blank" href="SlideImages/abc.doc" onclick="getAttr(this)"  name="1,16" title="rupesh tesr" id="MyLink">rupesh test</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an assignment which involves adding some functionality to PostgreSQL on a Solaris
I'm currently writing a function for parsing some HTML and adding tags where necessary.
I'm writing some html code to make an html email. I've done some research
I am writing some BASH script and I want it have some error handling
I am writing some unit tests in Visual Studio 2010. I can run all
I'm writing a custom thread which includes some added functionality. The part I'm confused
I am adding some functionality to the HtmlHelper-class. Basically I want to automatically disable
I am writing a multi language website. Therefore I would like some help with
I'm writing some kind of automated test suite and I want to make sure
I'm writing some codedUI tests in VS2010 to test a web application. I'd like

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.