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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying a label in the middle of the user's screen

Status
Not open for further replies.

KingRichard3

Programmer
Feb 9, 2005
58
US
I am writing an ASP.NET page using flow-layout. I need to display a confirmation label using VB.NET or JavaScript which needs to pop up in the middle of the screen (or at least visible to the user - even if they've scrolled very far down the page). It will need to say something like, [tt]"Product #" & insertProductIDFromVBdotNetCodeHere & " has been added to the cart."[/tt]

Any suggestions, please how to do that?

Thanks!
Rick
 
You can find out the users resolution and position the label accordingly with absolute positioning but you don't know if they have scrolled down the page or if they are at the top so it may be harder than you think to find the exact middle of the page that they are currently looking at.

Personally I would do something like redirect them to another page that says something like "Product added - click here to continue shopping" or find an alternative position to clearly inform the user that the product has been added (i.e. like displaying the contents of the cart - as an example have a look at and click the "buy" button for any item).

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
ca8msm,

Thanks for replying.

It doesn't need to be exactly in the middle of the page - but I don't want to do a redirect, either. I just want it to appear visible to the user - somewhere on their screen regardless of where they've scrolled to...

Isn't there some less-than-near-impossible way to do this??? There's gotta be!

Thanks,
Rick
 
In that case you could just have an anchor tag placed on your page and when you post back, redirect the user to the same but but with the anchor tag added. e.g.
Code:
Response.Redirect("SamePage.aspx#MyTag")

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top