No path is too difficult. No destination is too far !
How to open popup or redirect to web page in SilverLight
This is the code to open a popup window in SilverLight.
To open a website in a popup using SilverLight, we need to call Window.Navigate method. This method can be used in two different ways i.e. simply navigating to that webpage or using the window option [_blank, _self] etc.
// Navigate to the webpage itself
System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(”http://www.microsoft.com”));
//or if you want to open a popup (in a separate window)
System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(”http://www.microsoft.com”), “_blank”);
| Print article | This entry was posted by Ashish Sehajpal on February 16, 2010 at 5:09 pm, and is filed under Development. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |
Graceful Degrading to HTML or ASP.Net page
about 1 year ago - Comments Off
Have you ever wonder how Microsoft checks if the Silverlight plugin is not unstalled on your your system then the default ASP.Net website should appear otherwise new Silverlight website must be presented ? here is the trick called Graceful Degrading In case no Silverlight plugin has been installed on client’s machine, just present asp.net or HTML version
How to convert from IEnumerable to EntitySet to get Entity back in action
about 1 year ago - 1 comment
One way of achieving is to use what most google search results find on web i.e. public static EntitySet<T> ToEntitySet<T> (this IEnumerable<T> source) where T : class { var es = new EntitySet<T> (); es.AddRange (source); return es; } Then you could write your query as follows: var questions =
How to solve LoadFromRemoteSources error in VS 2010
about 1 year ago - 1 comment
I was facing an issue during the migration of my silverlight application to Visual Studio 2010. The issue was something like there are some references into the application from the network shared folder. When compiling the application there was a weird error saying : The “ValidateXaml” task failed unexpectedly. System.IO.FileLoadException: Could not load file or
How to pass InitParameters to Silverlight in HTML object control
about 1 year ago - 1 comment
There are three different ways in which we can pass parameters to Silverlight from the HTML side: 1. Pass parameters using the HTML object control. This may be the case using pure HTML page to call silverlight control in it or may be the simple ASp.Net page as usual. <object width=”100%” height=”100%”> <param name=”source” value=”ClientBin/SomethingFunny.xap”
Bind with Enum in Silverlight
about 1 year ago - 11 comments
Silverlight doesn’t have any kind of ObjEctDataProvider with it. So the famous example of binding the controls with an ObjectDataProvider doesn’t work with silverlight as it works with WPF <UserControl.Resources> <ObjectDataProvider MethodName=“GetValues” ObjectType=”{x:Type sys:Enum}“ x:Key=“AlignmentValues”> <ObjectDataProvider.MethodParameters> <x:Type TypeName=“HorizontalAlignment” /> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> This can be done via code behind in the Silverlight. Just
Unable to debug the silverlight project
about 1 year ago - Comments Off
I have some strange thing happening in my application. I was able to debug anything but silverlight code !! I did so much of RnD on net and tried various tricks, but only this thing worked : – When you add a Silverlight project to a asp.net solution, you create 2 projects… A. the startup
Versioning problem in reference.cs in WCF service consumption in Silverlight 2
about 1 year ago - 2 comments
A starnge problem occured when I was trying to add reference to one of my WCF service in my silverlight project. When deeply researched I found that some of the data contracts have been references twice in the reference.cs i.e. some classes with version 3.0.0.0 and some with 2.0.0.0 version. Strange!! A quick work around
Comments are closed.
about 1 year ago
Vegetables are a large part of my diet. I like eating healthy. I can’t believe how good for me it has been. I’ve lost a lot of weight just by changing my diet.