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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:01:50+00:00 2026-05-21T04:01:50+00:00

e.Row.Attributes.Add(onclick, location=’ + e.Row.Cells[5].Text + ‘); works fine but I want the new page

  • 0
e.Row.Attributes.Add("onclick", location='" + e.Row.Cells[5].Text + "'");

works fine but I want the new page to open in a new window.

e.Row.Attributes.Add("onclick", "target=_blank location='" + e.Row.Cells[5].Text + "'");

nothing happens. The source code inside the tablerow is:

onclick="target=_blank location='http://www.something.com'"

Do I need to do a window.open to accomplish this? If so, can someone provide syntax as my efforts to that effect have not been successful.

Thanks.

  • 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-21T04:01:51+00:00Added an answer on May 21, 2026 at 4:01 am

    onclick is looking for javascript… target, used in this fashion, is an attribute for an anchor tag…

    (IMO) window.open is your best/easiest option.

    onclick="window.open('http://www.something.com', 'mywindow')"
    

    unless you turn that row item into an anchor:

    <a href="http://www.something.com" target=_blank>Click Me</a>
    

    you can do this by creating a template column and building the link based on the data returned and the template it needs to fit into.

    open (URL, windowName[, windowFeatures])
    

    Changing the features of the Popup
    You can control the features of the popup using the last argument to the window.open method. The following code opens a window with a status bar and no extra features.

    window.open ("http://www.javascript-coder.com","mywindow","status=1"); 
    

    The code below opens a window with toolbar and status bar.

    window.open ("http://www.javascript-coder.com", "mywindow","status=1,toolbar=1"); 
    

    The table shows the features and the string tokens you can use:

    status The status bar at the bottom of the window.

    toolbar The standard browser toolbar, with buttons such as Back and Forward.

    location The Location entry field where you enter the URL.

    menubar The menu bar of the window

    directories The standard browser directory buttons, such as What’s New and What’s Cool

    resizable Allow/Disallow the user to resize the window.

    scrollbars Enable the scrollbars if the document is bigger than the window

    height Specifies the height of the window in pixels. (example: height=’350′)

    width Specifies the width of the window in pixels.

    Information obtained at: Using the Window Open Method.

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

Sidebar

Related Questions

EDIT1: btnDelete.Attributes.Add(onclick, String.Format(@return DeleteRow('{0}',{1},{2},{3});, e.Row.ClientID, e.Row.RowIndex, DataBinder.Eval(e.Row.DataItem, Id), ' + DataBinder.Eval(e.Row.DataItem, Name) + '));
I want to add row with remove button through javascript in html div formate.
I want to add Rows to a Table that already exists and each row
below is the code that works fine but the only problem i have is
Database row IDs are tied to the URLs like this: The page for row
I am enabling multiple row selection with clicking checkbox Item renderer. this works for
I am outputting a query but need to specify the first row of the
When I click on a row of gridview, I want its color to change.
I'm attempting to have an onclick event added to a row once the data
I am having a GridView in my page , I want that when a

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.