Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a pop-up window

Status
Not open for further replies.

choudhmh

Programmer
Aug 9, 2004
34
GB
Hi Guys,
Using the script below i'm trying to open a pop up window:

<asp:TemplateColumn>
<ItemTemplate>
<a id="description" target="_newwindow" href="<%# "details.aspx?bcstid=" & DataBinder.Eval(Container.DataItem, "BoilerCoverSupplierTariffID") %>"> Full Description </a>
</ItemTemplate>
</asp:TemplateColumn>

At present the link opens up as a new window. But i want to change this to open as a pop-up window. Does anyone knows what i need to amend to make this function take place.

Thanks
Mac
 
choud: Not sure how one might apply the "target" command to open up a pop up. I am putting a bit of javascript code below which does open up a pop-up window when called (and establishes a string for the redirect page picking up variables on the form).

This is not exactly what you're looking for but perhaps there is something here to help you along:

Code:
function getY1(){   
 var strPg;
 strPg = "setY1.aspx?Y1Max=" + document.forms["frmChemHist"].elements["txtY1Max"].value + "&Y1Min=" + document.forms["frmChemHist"].elements["txtY1Min"].value + "&Y1Int=" + document.forms["frmChemHist"].elements["txtY1Int"].value
 ChildWindow = window.open(strPg , 'newWinY', "width=210,height=250,top=200,left=320,toolbars=no,scrollbars=no,status=no,resizable=no");    
}
 
Hi Isadore

I really dont undersatnd whats happenning in your code to open a pop up. I have a hyperlink within a data grid colum. At presen tthe target=_newwindow shows tha data from that datagrid on a new window. I want to change that format so it is shown as a pop up instead of a new window openning up.
I know window.open will need to be used, but how do i construct the code that relates to my coding..

Thanks
 
What's the difference between a "pop-up" and a "new window opening up"?

If you want some content to "appear" within the browser, but NOT via the opening of a new browser window, you need to use some DHTML/CSS.

Write the content to a hidden div, and the toggle the div's visibility property.

And example of this is on my website,
Click the logo at the top, and an "about the logo" div appears, which acts like a window in that the user can drag it and close ie. Note that it was always THERE, but wasn't visible until you clicked the logo.

Is that what you're after?



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
yes exactly like this. you've did yours using php. any idea how i could do mine using vb.net
 
No, mine isn't done with PHP. I mean, yeah, the page is PHP, but only to load styles conditionaly.

The code to make the DIV visible is pure JavaScript/CSS. Funny to be talking about it in the ASP.NET forum, though.

Here's the relevant JavaScript:

Code:
  <script type="text/javascript">
  function showAbout()
  {
    document.getElementById("logo_container").style.visibility = "visible";
  }

  function hideAbout()
  {
    document.getElementById("logo_container").style.visibility = "hidden";
  }
 
  </script>

That will toggle the visibility of a div with id="logo_container".

If you found this post helpful, thank Tek-Tips by clicking and ad. Then go to my site and do the same!



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top