Click here to Skip to main content
13,090,930 members (46,870 online)
Rate this:
Please Sign up or sign in to vote.
See more:
The code looks like..
if (ddl.SelectedIndex == 10)
               string url="ABC-2118(10-09).pdf";
               Page.ClientScript.RegisterStartupScript(this.GetType(), "open", "OpenWinLIP178("+url+");", true);

var url;
  function OpenWinLIP178(url) {, 'LIP178', 'height=700,width=850,left=50,center=100,top=50,resizable=yes,scrollbars=yes, toolbars=no, status=no');

This code is not working for me.Its throwing the error like 'ABC' is undefined.Can anyone correct this code?
Posted 3-Jan-13 5:11am
CHill60 3-Jan-13 11:16am
Do you need to surround ABC-2118(10-09).pdf with quotation marks when passing it into OpenWinLIP178?
priya9826 3-Jan-13 11:17am
Yeahh..Got the solution.Forget to do that...Thank you very much
sisir patro 3-Jan-13 11:36am
Upvote the solution too...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


you can use like this:

protected void button_Click(object sender, EventArgs e)
        // open a pop up window at the center of the page.
        ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2); 'your_page.aspx', null, 'height=700,width=760,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=\'+Mtop+\', left=\'+Mleft+\'' );", true);

Refer the following links too.
open a new window
open a new window using jquery


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100