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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:25:34+00:00 2026-05-17T20:25:34+00:00

For my internal webpage at work, I display a DataGrid based on entries in

  • 0

For my internal webpage at work, I display a DataGrid based on entries in a SQL table (not directly, but with some processing on entries).

Each row in the DataGrid has a button that the user clicks. I need this button to open a new window or tab (I believe I can’t decide as this is based on browser config) and also change a value in the SQL table to say the button was clicked.

If I use an asp:Hyperlink then the page opens nicely, but I don’t know how to update SQL. Vice-versa if I use an asp:LinkButton I can get the SQL updated but can’t get a new page to open.

Is what I am trying to do impossible?

Thanks

EDIT:

I’ve tried both these in my .cs file, but neither worked:

ClientScript.RegisterStartupScript(GetType(), "openwindow", "window.open('" + url + "','_preview'");

Response.Write("<script type='text/javascript'>detailedresults=window.open('" + url + "');</script>");
  • 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-17T20:25:34+00:00Added an answer on May 17, 2026 at 8:25 pm

    You can use LinkButton and use OnClientClick property to set the java-script that would open the page in new browser window. This script must return true so that post-back can happen and you can handle click event on server side to update your database.

    IMO, better way would be to use hyper-link and open the page in new browser window. However, you must pass a query-string parameter while opening the page (say Page2) that would tell the new page that it should update the database. So url for opening the page will be something like "page2.aspx?recordId=xyz". And within page2.aspx.cs, you will have code such as

    protected void page_load(object sender, EventArgs e)
    {
       if (!IsPostback)
       {
          var recordId = Response.QueryString["recordId"];
          if (!string.IsNullOrEmpty(recordId))
          {
             // update database
             ...
          }
       }
       ...
    }
    

    From security perspective, you may want to include time-out within parameter value and encrypt the entire thing.

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

Sidebar

Related Questions

I want to modify an internal webpage to strip away some of the onclick
My drupal site (internal) will not display the TinyMCE editor when using Google Chrome
I'm tring to embed a webpage in an iframe, but it doesn't work at
I have built a suite of internal websites for our company to manage some
I'm trying to use some IE automation to process various internal webpages. Some of
I have built an internal Database for Clients. Its C# with an MS-SQL DB.
I don't work with Flash and consequently know nothing of it, but I have
I apologize for the length of this question, but some background explanation is required.
Internal links do not seem to be working in Android version 3 in my
I use XPath to parse a HTML webpage for fetching all internal links. DOMXPath

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.