Skip to main content
Microsoft Silverlight
Home Forums General Silverlight Programming Programming with .NET - General How to use silver light XAML controls in multiple aspx pages in asp.net website?
2 replies. Latest Post by jeetumaker on April 30, 2009.
(0)
kondamca
Member
24 points
86 Posts
04-29-2009 2:51 PM |
Hi All,
I have created a silverlight application with two xaml files search.xaml and results.xaml.Hosted in asp.net web application
asp.net web application having two aspx pages search.aspx and results.aspx.
I have to use search.xaml file control in search.aspx and results.xaml file in results.aspx.
when user enter his search info and click on search button which is there in search.xaml it should get the results from the service and bind the results to the grid in results.xaml file.
Is this possible to integrate two different xaml controls in two different pages?
How to integrate two different xaml controls in two different aspx pages?
How to transver the data between these above two aspx pages?
Can any one please provide some guidelines to solve my issues. Please provide any sample applications which is having this kind of requirements.
Thanks in advance.
Regards,
Konda.
Tony.Ch...
Contributor
3958 points
560 Posts
04-29-2009 3:54 PM |
Your best bet is to break it up into two Silverlight Apps, for two reasons:
First, since you are talking about two seperate aspx pages, you are going to have to pass the information from the search.xaml, in a link, to the results.aspx page. Then take the input in the results.xaml and load your grid.
Second, you can create multiple entry points into your application pass variables into your xaml, but depending on the growth of your application it doesn't scale well. You are loading the code and resources needed for both search and result each time. As you add controls this will make you xap even larger.
Is it possible to have a single aspx page in your application? That would simplify things greatly from a Silverlight perspective. You could even have Silverlight call out to AJAX javascript to update any portions of the aspx page.
Anyway, hope this helps.
Tony Champion
jeetumaker
525 points
92 Posts
04-30-2009 12:46 PM |
First of all as mentioned by Tony, try putting both the XAML on the same ASPX page as dividing your XAMLs across ASPX pages defeats the purpose of using Silverlight. You will be better off using ASP.NET alone. still if you need to span across ASPXX pages, another alternative is to store your results in IsolatedStorage and then have your second XAML read the ISOStorage. This way you will not be passing the same data back and forth to the server multiple times.