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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:35:19+00:00 2026-05-28T13:35:19+00:00

I had used a webgrid and displayed the data fine.For one column in the

  • 0

I had used a webgrid and displayed the data fine.For one column in the webgrid i had used

 grid.Column("SlmgReferenceNumber", header: "SLMG Number", format: @<text><label><a href="#" id="messages_slmgid" onclick="return MessagesViewClaim(this, '@item.NoteId', '@item.DealerId', '@item.SlmgReferenceNumber');">@item.SlmgReferenceNumber</a></label></text>),

i used ‘this’ as parameter in the function of onclick to get that particular anchor element but i cannot able to get it. It returns the url of the page. How to resolve it. I want the particular anchor element as the parameter in the onclick function.Can anyone please help me to find the solution..

  • 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-28T13:35:20+00:00Added an answer on May 28, 2026 at 1:35 pm

    No, you must have mistaken something. I suspect you have used an alert on the first argument instead of using console.log. Never use alert to debug your javascript code. It will show you things that are completely wrong.

    This doesn’t return the url of the page. It returns the anchor element that was clicked:

    var MessagesViewClaim = function (anchor, noteId, dealerId, slmgReferenceNumber) {
        // here the anchor argument will point to the anchor DOM element that was clicked
        alert(anchor.id);
    };
    

    will show the id of the anchor. Unfortunately in your example you have given all your anchors the same id (messages_slmgid) which obviously results into invalid HTML but once you fix that you should be OK.

    All this to say that apart from the id collision on your anchors your code works perfectly fine. You just didn’t use the proper tool to verify it. I’d recommend you FireBug in FireFox.

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

Sidebar

Related Questions

I had used a webgrid in a partial view in my project. I had
I want to display image in TextView with text, I had used Html.ImageGetter but
I had used JExcel API for importing Data's from Excel,for using JExcel , I
I had used the same plot as attached, for another question. One could see
I had used the SqlDataSource to retrieve data from database to gridview. <asp:SqlDataSource ID=SqlDataSource1
I had used Server Explorer and related tools for graphical database development with Microsoft
I had used several ways to do some simple integer arithmetic in BASH (3.2).
I had used the below code to get the row index of the UIPickerView
I'm looking into development standards fro JavaScript. I had previously used Doulgas Crockfords Javascript
I had a property that used to be not-null=true. Values aren't necessary for that

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.