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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T07:56:50+00:00 2026-05-17T07:56:50+00:00

I am trying to open an preview.aspx page in a seperate window from INSIDE

  • 0

I am trying to open an preview.aspx page in a seperate window from INSIDE an ajax modal popup.
I have tried doing it with client side scripting using the onClientCLick preview.target _blank etc but this doesn’t work at all.
I have now managed to at least get this working within my lbPreview_Click routine but this requires a 2nd click because i am using the Attributes.Add to open window (the only way it would work so far!):

protected void lbPreview_Click(object sender, EventArgs e)
{
    string recordNo = lblRecordNo.Text;
    string details = txtQuery.Text;
    string reason = ddReason.SelectedItem.Text;
    string fullName = lblFullName.Text;
    string path = "emailPreview.aspx?recordNo=" + recordNo + "&details=" + details + "&reason=" + ddReason.SelectedItem.Text + "&fullName=" + fullName + "";
    lbPreview.Attributes.Add("onClick", "window.open('" + path + "');");
}

PLease note: I don’t have the values to build my url path until the button has been clicked, so calling the details on page load or similar won’t work either.

Any suggestions/help would be very much appreciated.

Kind Regards,
ukjezza.

  • 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-17T07:56:51+00:00Added an answer on May 17, 2026 at 7:56 am

    You should use java-script to lookup into control values to build the URL and then open the window. For example, consider following js function on aspx page

    function openPreview() {
    
       var recordNo = document.getElementById('<%= lblRecordNo.ClientID %>').innerHTML;
       var details = document.getElementById('<%= txtQuery.ClientID %>').value;
       var reason = document.getElementById('<%= ddReason.ClientID %>').value;
       var fullName= document.getElementById('<%= lblFullName.ClientID %>').innerHTML;
    
       var url = "emailPreview.aspx?recordNo=" + recordNo + "&details=" + details + "&reason=" + reason + "&fullName=" + fullName;
    
       window.open(url);
    }
    

    Should be invoked on click of your preview button/link.

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

Sidebar

Related Questions

I'm using the following code to open a blank window from a secure page:
I am trying open a new window using url.Action. And the new Window url
I'm trying to open a JSON file from the assets folder with an InputStream
I'm trying to open a file and read from the last point read. My
I'm trying to open a file in Openoffice from terminal and to automatically replace
Some links on our page open in a new window using target=_blank. How can
I am trying to open files with FileInputStream that have whitespaces in their names.
I have created an application where i have a camera preview. I am trying
What Im Doing: Trying to call Fancybox from an iFrame to be appended to
im trying to open a popup with nothing but the content using javascript in

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.