papa_k Posted September 16, 2003 Posted September 16, 2003 there is nothing more annoying than a popup when you do something on a web page. but, in the instance i have got i need to navigate the main page the user has been using away from where is it and to a main menu page. i need however to display details of the action that the user just carried out. eg record the stock id they just worked on just in case they needed to note it down. if they dont they can just close the window. if i was to use a pop up what would most user friendly method. what user friendly methods have people used? Papa. Quote without time nothing ever ends
Moderators Robby Posted September 16, 2003 Moderators Posted September 16, 2003 you can do it using javascript... <script language='JavaScript'> function OpenPopup(){ myWin=window.open('popup.aspx','Title','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=480,height=500'); } </script> You can also generate a javascript function from code-behind using Page.RegisterClientScriptBlock() Quote Visit...Bassic Software
papa_k Posted September 16, 2003 Author Posted September 16, 2003 ok, dumb question i should think. where does this code go. does it go in the html of the page that i want the pop up to appear with does it go in the load function of that page does it go somewhere in the button of the previous page thanks for your help. Papa Quote without time nothing ever ends
Moderators Robby Posted September 16, 2003 Moderators Posted September 16, 2003 The <script> tags go into the <head> section of the aspx file that is calling the popup. Then you can call it by doing something like this... <a href='javascript:OpenPopup()'>Open some popup</a> Quote Visit...Bassic Software
papa_k Posted September 17, 2003 Author Posted September 17, 2003 similarly you could get it to pop up when the page opens? How would you do that? Quote without time nothing ever ends
Moderators Robby Posted September 17, 2003 Moderators Posted September 17, 2003 So you want a popup window to open when page x is open? If so, do somethng like this... <body onload='javascript:OpenPopup()'> Quote Visit...Bassic Software
papa_k Posted September 17, 2003 Author Posted September 17, 2003 thats the one. works fine. thanks very much for your help... papa. ***** CLOSED ****** Quote without time nothing ever ends
papa_k Posted September 18, 2003 Author Posted September 18, 2003 ***** this is no longer closed ****** i think i need some help with my logic on this one, heres what happends... i have information submitted by the user. this information is given a reference number upon the pressing of a submit button. when the submit button is pressed the reference number is sent to the next page (page_move_me) which opens on the screen. the reference number is sent within a query string. then the string is displayed on the screen in a lable. At this point i want another small window to open that displays the reference number within it. This should open automatically either on the load of page_move_me or the press of the submit button. i can get the window to open but HOW DO I GET THE REFERENCE NUMBER TO BE DISPLAYED ON IT? I can either get it from the page_move_me or the original entry page, as they will both have the value on them, but i dont know how to do this within either the load or the submit press. The page_move_me has a auto redirect on it, and it is only displayed for 15 seconds. This is to stop the user from resubmitting the information. robby if you pick up this one again i am sorry. someone please help, this is doin my head in... Papa. Quote without time nothing ever ends
papa_k Posted September 18, 2003 Author Posted September 18, 2003 got this one to work ok, it creates the java script dynimacally and then puts it on the page. anyone got anything better, please do tell. this seems a bit of a bodge way of doing it considering what ASP.net should be able to do. Dim strScript As String strScript = "<script language=""JavaScript"">" strScript = strScript & vbCrLf & "<!-- " & vbCrLf strScript = strScript & "myWin=window.open('thepopup.aspx?" strScript = strScript & "variable=" & Request.QueryString("othervariable") strScript = strScript & "','Title','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=360,height=60');// --> </script>" Page.RegisterClientScriptBlock("PopUp", strScript) Quote without time nothing ever ends
Moderators Robby Posted September 18, 2003 Moderators Posted September 18, 2003 That's pretty much it if you want client side stuff. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.