Once a Silverlight application has been installed as an out-of-browser application, I know I can update it by calling the Application.Current.CheckAndDownloadUpdateAsync() method. This will check the URL where the XAP was originally downloaded and update if necessary.
But what if, somewhere in the future, I would want or need to change the url of the XAP? The domain name changes, the location on my site, etc.
Is there a way of indicating where the OOB application should check for the update?
Now I know of the /origin property, but as far as I know, there's no way to set this when you let the user just install it by clicking on a button on your site (or right clicking in the application). Also, I don't know of a way of changing it at a certain point in time. Other than letting the user do it manually, that is. But that's not very user-friendly.
If it is entirely not possible, maybe a redirect could do the trick?
So is there a way to programmatically define/change the URL of a XAP?
You can not change origin url for installed OOB application. Not without asking user to uninstall and re-install application from new location. It is not all that user friendly, but it is transparent to the user.
Ideally origin url should not change during life time of the application. Using server side url rewriting (maybe redirecting too) should be fine if you would like to move xap file around. If changing domain name is unavoidable you could push an update to the users that reminds them that application moved to different domain and it needs to be re-installed.
Related
As we all know very well..
whenever we create application inside silverlight it is asking us for hosting it
by dialogue box at given below.
My question is what if i unchecked the check box[Host the silverlight application in a new web site].
Means what kind of problem we have to face later if I don't host our Silverlight Application in any of the option given by dialogue box.
Basically it is not a problem at all. You can add a website at any time later.
In the project settings of a website there is a Silverlight tab. Under that you will find the option to add Silverlight projects to the website. This will setup the links to generate the XAP in ClientBin as well as giving you the option to create test pages for each Silverlight app added. The test pages will give you the sample JS you need to host your Xap later.
You will have to eventually host your application somewhere otherwise it will stay on your local harddrive and hardly reach any clients. So if you have an existing web site you could simply copy-paste the necessary javascript to this site later in order to embed your Silverlight application. In this case you can uncheck this checkbox.
I have a custom Salesforce (Summer '11) button. Clicking the button navigates the user to a url in a new window. The url points to my own custom web app. (It does not point to the same url as that of the salesforce environment).
I want this url to be configurable for my dev, staging and live environments, so that the button in the SalesForce dev environment points to the app's dev environment, and so on.
If possible, what's the best way to achieve this, given that I'll be deploying the customization in dev (inc. button, but other things too) via a changeset which I'll push to the staging and live environments?
You would want to implement this using a custom setting. Sadly it's not yet? possible - we need to vote: success.salesforce.com/ideaview?id=08730000000I5NsAAK
As long as your button URL is pointing to a relative path rather than the full path including the server instance (and, of course, as long as the path exists) your button will work across server instances without any fuss.
For example, do: /{!Account.Id}/e? etc.
do not: https://eu1.salesforce.com/{!Account.Id}/e? etc.
I'm developing a Windows Application in C sharp.using a Web Browser control to Login to the Https Site and Download the List of files. I'm able to login in to the Site and I'm able to Navigate to the Page where files are listed to be downloaded. When I try Downloading the file using the file URL and trying to Navigate using Web Browser Control a Pop - Up appears asking whether to Open or Save or cancel. How to handle this Pop up and I'm stuck here.
Any Answers are appreciated.
Thanks,
Vinay.
If all you are trying to do is download a file, you might be better off using webRequest.Create("Url") instead of the WebBrowser control. There are ways of handling authentication depending on the method the website uses.
It's best not to use the WebBrowser to download files (unless initiated by the user, who can click the save button). Instead, you can use a WebRequest to download the files from your application.
Since you said you have to log in to the website, I'm going to assume that it uses the popular method of using cookies (as opposed to HTTP Basic Auth). To get the cookies from the WebBrowser, you can use the Cookie property of the WebBrowser's Document property.
I have a WPF intranet app running in Trusted mode (local only).
I would like the users to be able to upload an image and attach it to an article on my newsletters section. I am having trouble deciding where these images will be stored.
Please provide me with your opinions.
At present I have a few ideas myself;
I could have an aspx page that runs parallel to this app, and run this inside a browser(I-frame). This page could then handle the upload and display of the image.
I could also, have the users copy directly to a network share.
It seems that there should be a more elegant sollution that I am not aware of.
Any ideas?
Don't force the solution towards ASPX just because you know how to do it there. It's unnatural to build a page, host browser to show that page etc, just so you could upload an image.
It's actually quite simpler to do it in a desktop client than on web page. You have a "Load File Dialog" - use that to get to the filepath the user wants to upload, and when you have that you can either:
copy it (inside your application) to your share,
or if you have a service - send it through some method call,
or you can even store it inside a database (recommended if the files are small)
There's really lots of options here... it depends if your client has connection to db, do you have service in between, etc...
I want to save user name and password in a cookie.mine is a win forms application.Please advice how can we do this.
Thanks
In win Forms you should use registry,files,databases.... not cookies, cookies for web applications that usually be displayed in web browsers.
I would suggest using a password protected SQLite database (see System.Data.SQLite) and storing whatever you want there.
Also, do remember to hash your passwords!
This is not supposed to be an answers - more of a comment. Apologies if I posted it in the wrong way:
I expect the person asking the question may be aware that this is not the optimal way to store info in a winforms app. I would also like to know how to do this as a possible way of passing information from a website to a desktop app? For example you want the same app to do different things depending on information pass to the app from the website.
I've found that you can Retrieve Query String Information in a ClickOnce Application (http://msdn.microsoft.com/en-us/library/ms172242.aspx) which allows you to pass information from a site to an app. I want to know if cookies could also be used to do this.
I suspect it would be difficult and not practical in many situations to read info from a cookie in this way. One way I can think of doing this is putting a GUID in a cookie and also hardcoing that GUID into the app and running a find in files over the computer to find it. I realise that's a very ugly method but I would like to know what's possible.
I suppose another way might be to embeded a Webbrowser control in a winforms app and get the Webbrowser control to load a page containing JavaScript which reads that cookie. You would then need some way of passing that back to the .NET code though?
First, we can't use Cookies in WinForm applications.. it's a Web side functionality, but you can do something else..
For instance, once I had to do the same thing... to save the latest user connected to the application. I did it with a database (I prefere database, because txt files are not that safe.. we can erase them by mistake..)
So I suggest to save the username (and password in your case) on the database after every Connection event.
Hope that was usefull.