Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

without time nothing ever ends
  • Moderators
Posted

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()

Visit...Bassic Software
Posted

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

without time nothing ever ends
  • Moderators
Posted

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>

Visit...Bassic Software
Posted

***** 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.

without time nothing ever ends
Posted

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)

without time nothing ever ends

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...