Facebook like button with silverlight - asp.net

I have created a silverlight app that consits of like buttons within specific usercontrols (all in one asp page). Ie.
foodingtons.net/index.aspx?id=211
It is all incorporated within the silverlight app on one page. Hence when the control is loaded the meta tags are updated and the like button is placed within an iframe and linked to the appropriate page. When the like button is pressed a javascript function is invoked which changes a picture behind the silverlight obj. This picture in theory should be used as the default image after the like button is pressed (on clients page). But it seems to be stuck on old images.
Ie.
foodingtons.net/index.aspx?id=211
(the above is using an image which doesnt even exist)
foodingtons.net/index.aspx?id=218
(is using an image from the main page)
foodingtons.net/index.aspx?id=219
(fails.. the website is inaccessable)
I have also tried create the open graph tags with in the page to reference new images but to no avail.
I'm using the following facebook tool to debug as well
https://developers.facebook.com/tools/debug
a bit lost ... any suggestions?

Take a look at Add Facebook Like to your Silverlight Application.

Worked out what was going on. Facebook and google (using their bots) cannot crawl into the silvelright control itself. So they cannot invoke the functions that will get the meta and pics changing. Had to call the change meta stuff from the asp page itself. All sorted.

Related

HTML Change button state permanenty

I am completely new to web development. The question I have is rather simple (I guess), but after multiple hours of using google and experimenting I am still without any solution. The problem I have is probably not how to do it, but which keywords to use while searching.
I want to create a simple website. (For testing I use Caddy Server). For my website I use a simple index.html file. On my website I want to have 9 buttons, which will be disabled once clicked. After refreshing the page, every client should also see the changes, so the button-state has to be stored somewhere on the server.
Then there will be another button, which sets the web page to its initial state (all buttons enabled). The purpose of this web page is that 2 persons can click buttons successivley until only one button is left enabled (the web page reloads itself every second on every client). This will be used to select a certain map from a map-pool of 9 maps.
My main problem is, to store the button states, so after refreshing the page the buttons should be still disabled if they were clicked. All clients should see the buttons as diabled once they refresh their pages. Do I have to implement a database for this or store the button states in xml or json? Do I need javascript, jquery, php or ajax for this? I do not want to make it very complicated, so if I need for example a database for this, I will probably just give up.
What I'm asking for: Any point in the right direction on how to implement a simple button that keeps its state after reloading the page would be much appreciated. I found a solution for this using JQuery, but it does not work for me (button does not preserve state after refreshing See here).
Thank you so much for any help!
Your server will need a data store (database) to save the values desired for each button.
Client Side
Set disabled attribute on all relevant buttons in your HTML. On (client-side) page load, fetch the value(s) from your server (database) and depending on what the returned value(s) are, .clearAttribute("disabled") on all buttons accordingly.
Server Side
Have your server set the disabled attribute on the HTML <button> elements based on values in your database prior to serving the HTML to your client(s).

how to create a pop up window #2

is there a way to create a pop-up window in a VB.Net application, specifically when a button has been clicked?
I'm designing a little help section on a web application I'm working on, and I wanted to have a variety of written steps followed by some sort of "Click here for an example" button that brings up a new window (not a new page, just a new window). The window would simply contain an image control displaying a picture that describes the written steps.
The best example I can come up with is here on Amazon when ordering a clothing item such as a pair of shoes. When the user clicks the "Sizing Info" link button, a pop-up window appears with information to help you order the correct size.
So is there a way to create a pop up like that in VB.Net?
In vb.net not, websites are handled differently. For displaying a popup using asp.net you need a client-side language, like javascript.
For instance this nice jquery script http://jqueryui.com/dialog/
Your vb.net can't open dialogs on client-side. If you need to get/send some information from the server, simply use webservices to send/fetch the information using ajax.

Adding lightbox (or something similar) to ASP.NET project

I need to implement some, let's call it "dialog" in some old ASP.NET project that I took over. It's huge project so I'm not allowed to implement new things.
I have a form on which user can attach up to 3 file attachments, enter some 10-15 fields, and when required fields are filled, submit button get's enabled.
What need to be done is press submit, wait for any possible response for server, and then display some sort of dialog, alert, lightbox which would display short summary and list of correctly uploaded files.
What would be the best approach to do this in ASP.NET?
Considering jQuery Lightbox is designed for overlaying images rather than HTML I would recommend using FancyBox or FaceBox instead.

First deployment, ASP.net image buttons not showing when page is first loaded

I finally got my site to work on my server, and it is now visible at http://www.mhn.co but when you click on any of the categories on the top it loads a professional's profile, but the image buttons I'm using like tabs on the profile content don't load, and just display "Submit Query" until clicked on, then the images load. This is my first asp.net site that I've deployed so I'm pretty unfamiliar with how this should work. The server is running asp.net 2.0, 3.0, and 3.5, and my site is using 2.0
Are you assigning image on load ? Cause the src is null or empty at first. And on the click
you probably added the image on postback or something.
before click :
src = "";
after click
src = "./css/img/content_tab_profile_rollover.jpg"
Try adding image on the load
It's not a problem with the server. It's a problem with the markup or control you're using. Because if you look at the image URL it's trying to use when it first loads it's "http://www.mhn.co/profile.aspx?name=Mounir". But then when you click it works because it points to "http://www.mhn.co/css/img/content_tab_profile_rollover.jpg".
Without seeing your code/markup we can't really do much more. But that is where I'd look

Options for displaying existing ASP.NET WebForm in a lightbox

I have been given a requirement to take an existing stand-alone web-form (i.e. uses postbacks) and throw it into a lightbox.
The standalone web-form already has save and cancel buttons that have predefined behaviors. For example, the Save button attempts to save the form, and either displays validation errors, or if the operation was successful, redirects to some other page in the app.
However, in the context of this new "lightbox mode", the Save button should additionally close the lightbox if the operation was successful.
I see two options:
Option 1-->UpdatePanel + ModalDialogExtender:
a. Extract a UserControl out of the standalone web-form that includes everything but save/cancel buttons
b. Introduce Save and Cancel EventHandlers on said UserControl
c. Use this UserControl on both the standalone and lightbox versions of the page, and wire up the events appropriately
Option 2-->Client side lightbox (i.e. jQuery)
a. ....
I'm a big fan of jQuery and tend to favor its use for Ajax functionality b/c of the level of control it gives me. On the other had, I also want the simplest solution that will possibly work. Assuming that option 2 is that option, any guidance on how to proceed would be appreciated.
I am using fancybox (see http://fancybox.net/home) with great success. It has a mode where it can show my aspx page (usually an edit form without menus and so on) in an iframe fancybox.
It can also be closed from javascript in the iframe.

Resources