Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have a form with a datagrid on it that allows users to view details of the transactions listed in the grid. Right now, it hyperlinks to an existing page (I set the target="_blank" so it opens a new window) which shows the desired records.I am wondering if there is a way to make the new window essentially a popup window or in some way control its size?
Posted

i had some old code that did that.. i don't have all of it but here is a snippet... let me know if it looks like something you could use.. if so, i'll try to dig up the project and see what the full code was

 

sURL = "PartInfoQV.aspx?IsPopup=Y"
           sFeatures += (",height=770")
           sFeatures += (",width=900")
           sFeatures += (",top=75")
           sFeatures += (",left=75")
           sFeatures += (",resizable=yes")
           sFeatures += (",scrollbars=yes")
           sFeatures += (",status=yes")
           sFeatures += (",menubar=yes")
           sDHTML = "<script language=JavaScript> var myWindow; myWindow=window.open("
           sDHTML += ("'" + sURL + "', ")
           sDHTML += "null, "
           sDHTML += ("'" + sFeatures + "'); myWindow.focus();")
           sDHTML += "</script>"
           Page.RegisterStartupScript("Popup", sDHTML)

Posted

actually, that looks like it may be all of it... i'm not sure if this will work in a hyperlink.. you may need to make that column a link column (not sure if they are the same things) and then add the code to the 'ItemCommand' event.

 

Also, I'm new to all of this so there may be a better way to do it. Good luck.

Posted

You could always try using javascript, and configuring the new window so that the all the user see is the text area and the minimise, maximise, and close button.

 

Try this:

1. Add to the html section.

function newWindow(){
var doc = document.forms[0];
window.open("http://localhost/webAppFTP/WebForm2.aspx", "Welcome", "width=350, height=25, resizeable=0, menubar=no, scrollbars=no, status=yes, left=0 , top=0")
}

WebForm2 is actually the page that displays all the information that the user needs.

 

2.Create a button, set its visibleity to false. In the page load event add the following

button.attributes.add("onclick", "return newWindow();")

 

When you want to display the new window, just call the button's method

 

Mike55.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...