Reputation: 659
I use mvc4/razor.I need a popup like the image attached. I Got the jquery from coda for creating popup. http://jqueryfordesigners.com/coda-popup-bubbles/
But how to get details from a database to load it into the jquery popup?
(I created this image taking stackoverflow as example.On mouseover the "username", creates a popup with the userdetails)
Upvotes: 1
Views: 1166
Reputation: 4770
That is a very big question, and a detailed and complete answer would take a long time for someone to write for you. I can, however, give you some pointers to get started.
There are really three things you will need to be able to do to achieve what you are trying to do. I suggest you work on these one at time, and each step will build you up to your final goal.
1. Retrieve the user details from the database and display in the view, without the pop-up.
Your first step is to get the user details to show up on the page. It is unclear from your question whether or not you can do this already. If not, I suggest you read up on EntityFramework
- this will get you started.
2. Get the JQuery pop-up working, without querying the database
Next, make the pop-up display a random string of text. Again, it is unclear if you already know how to do this. If not have a closer look at the tutorial you linked to and try and get it working.
3. Loading user details through AJAX
The next step is to be able to load the user details via AJAX
, and probably render the result as a PartialView
, or maybe in JSON
format. Google for some tutorials on MVC
AJAX
and Partial Views
.
4. Putting it all together
Your last step will be to put it all together. You will need to modify the JQuery in Step 2 to load the user details via AJAX as in Step 3.
Upvotes: 2