|
Good job
|
|
|
|
|
I check on the Internet - and i actually try anything i found ... and still nothing work.
I have simple server that i wrote using WCF ( .net 4.0 ) and simple silverlight ( .net 4.0 ) application that use this WCF service.
Both of them are on the same sulotion.
I want to use the IIS ( 7.5 ) - so in compiling i define the visual studio to 'use local IIS web server'.
Now, when i testing my silverlight apps on debug - i see that all work fine ( the WCF service call work fine ).
But when i ran it directly from the explorer i see that i get message about that the silverlight app. can't call the WCF service.
( cross-domain problem )
The exception error is:
An error occurred while trying to make a request to URI ‘http://localhost/MyService’. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. Please see the inner exception for more details.
I try to add clientaccesspolicy.xml and crossdomain.xml file to the WCF folder ( the folder that contain the .cvs file )
I try to add clientaccesspolicy.xml and crossdomain.xml file to the WCF folder that contain the interface contract files.
But still nothing work.
I still get the same exception message.
Is there some code example to see how to do it right ?
|
|
|
|
|
You need to locate the clientaccesspolicy.xml file in the root of the domain that you intend to serve the data from. So, if you were hosting it as http://localhost/MyApplication/MyService.xml, the policy would be http://localhost/clientaccesspolicy.xml and not http://localhost/MyApplication/clientaccesspolicy.xml.
Note: Similar logic applies to the crossdomain.xml file.
|
|
|
|
|
I can access to http://localhost/clientaccesspolicy.xml
The clientaccesspolicy.xml is
<br />
<br />
<?xml version="1.0" encoding="utf-8" ?> <br />
- <access-policy><br />
- <cross-domain-access><br />
- <policy><br />
- <allow-from http-request-headers="*"><br />
<domain uri="*" /> <br />
</allow-from><br />
- <grant-to><br />
<resource path="/" include-subpaths="true" /> <br />
</grant-to><br />
</policy><br />
</cross-domain-access><br />
</access-policy><br />
<br />
and still nothing help.
|
|
|
|
|
What about your crossdomain.xml? What happens if you browse to http://localhost/crossdomain.xml?
|
|
|
|
|
I can see the crossdomain.xml also when i try to enter
http://A.B.C.D/crossdomain.xml
from explorer - from different machine ( A.B.C.D is the server machine IP )
|
|
|
|
|
The first thought I have is that perhaps SOAPAction has been blacklisted. In the section
<allow-from http-request-headers="*"> change this to <allow-from http-request-headers="SOAPAction"> instead.
|
|
|
|
|
Hi,
There are two usercontrols i.e. page1.xaml, page2.xaml in my silverlight project which I am using like pages.
There are alot of codes in each usercontrol...
I would like to have one main page with a tab control and tab1 to show page1 and tab2 to show page2.
Is this possible?
Is it just a matter of referencing each control from each tab in the tab control?
Thank you
|
|
|
|
|
yes, this is possible.
you will have ( in the simple way ) reference to the tab control.
[I'm not sure but i think you can access to the usercontrol by calling too tabControl.Items - but any time you can use events to communicate with the userControl.
|
|
|
|
|
arkiboys wrote: would like to have one main page
This is exactly how we have designed our apps, you need to implement the navigation frame.
<Navigation:Frame x:Name="MainContent" Grid.Column="1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
Source="Home" UriMapper="{StaticResource MyMapper}">
Our pages are usercontrols (this change is minimal) and we set the source have on user selections
Look into xmlns:Navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is what I am trying to do now.
My main page has the navigation frame with the navigation menue on the left hand side.
Clicking each linkbutton in the menue will navigate to the desired page and show the page inside the mainframe.
Question:
In page2.xaml, I have placed a button, and wouold like it to navigate me to the page1.xaml when clicked.
So, in page2.xaml, I have placed the namespace for navigation and the following code in the button
private void btnNavigate_Click(object sender, RoutedEventArgs e)
{
mainFrame.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
}
BUT the problem is that mainFrame is on the mainpage.xaml and not on page2.xaml, so I get an error when running the application.
Does this mean I have to copy the mainframe xaml to the page2.xaml as well?
Thanks
|
|
|
|
|
I have a static class that handles the navigation.
public static class MainUI
{
public static void NavigateTo(string sViewName)
{
Frame oFR = (Application.Current.RootVisual as FrameworkElement).FindName("MainContent") as Frame;
NavigateTo(oFR,sViewName);
}
public static void NavigateTo(Frame oFR, string sViewName)
{
oFR.Navigate(new Uri(sViewName, UriKind.Relative));
}
The default is to use the main page navigate frame but I also use navigate frames within other pages.
private void ControlNavigate(object sender, RoutedEventArgs e)
{
Frame oFrame = this.FilterContent;
string sURL = "Blank";
switch ((sender as HyperlinkButton).Content.ToString())
{
case "Accounts":
sURL = "AccountFilter";
break;
case "Elements":
sURL = "ElementNodeFilter";
break;
case "Products":
sURL = "ProductFilter";
break;
}
gUI.NavigateTo(oFrame, sURL);
}
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
Thanks for the reply...
In my silverlight application, my main page is called HomePage.xaml which is a user control.
1- In regards to your second code which is ControlNavigate, does this have to be placed inside a navigated page or a usercontrol?, it's just that if I place it inside my page2.xaml, the compiler underlines an error for:
this.FilterContent and gUI
2-There is a Login.xaml which is a usercontrol. From page2.xaml I can now navigate to login.xaml using the code you sent.
BUT, using the button in login.xaml, I am unable to navigate to another page. When debugging, it seems your code for navigatioin does not give any error but it goes into Application_UnhandledException inside app.xaml.cs
Any thoughts on the above point please?
Thanks
modified on Thursday, March 31, 2011 12:50 AM
|
|
|
|
|
Good Evening
I have a Datagrid and i selectedChange event of the Datagrid, i show a child wind and i bind the textbox controls of the child window from the Parent Window which has a datagrid. Now my problem is that there is a Combobox on the Child window, onbviously this combobox is binded after the child window has opened. The data is not Static , its coming from the DB. What i want is to set the selected item from the parent. This is what i am doing
private void grdkids_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
{
KidsViewUpdateDetails KidsDetails = new KidsViewUpdateDetails();
KidsModelExtended model = (KidsModelExtended)this.grdkids.SelectedItem;
KidsDetails.txtstudentnumber.Text = model.sStudentNumber;
KidsDetails.txtkidname.Text = model.sKidName;
KidsDetails.txtkidlastname.Text = model.sKidLastname;
KidsDetails.txtgrade.Text = model.sKidGrade;
KidsDetails.txtclass.Text = model.skidclass;
KidsDetails.ddlallergies.Text = model.sAllergyName;
KidsDetails.ddlschool.Text = model.sSchoolName;
GenericMethods.GenericMethods.SetCookie("kidId", model.iKidid.ToString());
KidsDetails.Show();
}
in this lines
KidsDetails.ddlallergies.Text = model.sAllergyName;
KidsDetails.ddlschool.Text = model.sSchoolName;
i am trying set the selected item to be that. but when the Child load , there Combobox remain unselected
This is the declaration of the Combobox
<telerik:RadComboBox HorizontalAlignment="Left" DisplayMemberPath="sAllergyName" SelectedValuePath="{Binding iAllergyID}" Margin="106,226,0,0" Name="ddlallergies" VerticalAlignment="Top" Width="142" Height="22">
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I have found the combobox the most irritating control in SL, if any of the underlying data objects is changed, the combos binding is negated. I have a BindCombo() in the code behind. This renews the binding after the page has loaded and if any of the data sources change state (.Clear(), or new on the observablecollection that serve the itemssource and the selecteditem).
If the binding is setup properly then changing the selecteditem in the datasource of the datagrid should automatically update the combobox selected item.
You need to get away from manipulating the UI elements, its so... winforms.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I must agree , it is really annoying. This is supposed to be a simple thing.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi All,
I had developed a Word Add-in using WPF Ribbon. The Ribbon has a button which displays a WPF Window on clicking. On running the Add-in in my machine, the window gets displayed and its runs well, but on installing the add-in in one of production machine, I am not able to see the Window. What's even more surprising is that, the code-behind the window runs but the Window UI doesn't get displayed. This is very weird and I am not able to find the solution for it.
Need your valuable solution for it.
But this problem is only with few computers, I am kind of stuck. Please help!
Thanks,
Vikas
|
|
|
|
|
Are you sure you have the proper version of .NET installed on the production machine? I'd be surprised if you aren't getting any runtime errors if its not working.
|
|
|
|
|
Well, I am also assuming the same thing, as there was a Silverlight 4.0 installed against the standard Microsoft .net 3.5 SP1 for our company. I have just uninstalled all the frameworks and trying to re-install to see if I get any luck!
Thanks,
Vikas
|
|
|
|
|
First of all, Silverlight is not installed against the standard .NET runtime. It uses it's own version - which is a stripped down CLR designed to be delivered in an efficient manner over the web. Secondly, Silverlight 4 is a subset of the .NET 4 runtime, not the .NET 3.5 one. It sounds to me like the app just isn't firing up due to missing prerequisites. Try checking the event logs to see if Office has written anything there.
|
|
|
|
|
Hi,
Im new to coding in XAML and silverlight.
I keep getting the error The Property 'Content' is set more than once.
This error came up after I added in the top stack pannel.
This is prob a very simple error to fix but I can see where I am setting the content again.
<controls:PanoramaItem Header="">
<StackPanel Height="100" HorizontalAlignment="Left" Margin="107,260,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="200">
<Image Height="112" HorizontalAlignment="Left" Margin="12,184,0,0" Name="userProfilePhoto" Source="{Binding UserProfileImage}" Stretch="Fill" VerticalAlignment="Top" Width="111" />
<TextBlock Height="44" HorizontalAlignment="Left" Margin="129,184,0,0" Name="userProfileName" Text="TextBlock" VerticalAlignment="Top" Width="297" />
<Image Height="77" HorizontalAlignment="Left" Margin="350,219,0,0" Name="userProfileMood" Stretch="Fill" VerticalAlignment="Top" Width="76" />
<TextBlock Height="157" HorizontalAlignment="Left" Margin="129,219,0,0" Name="userProfileStatus" Text="TextBlock" VerticalAlignment="Top" Width="221" />
</StackPanel>
<ListBox Margin="0,150,0,0" ItemsSource="{Binding Items}" Height="402">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17" Width="432" >
<!--<Rectangle Height="100" Width="100" Fill="#FFE5001b" Margin="12,0,9,0"/>-->
<TextBlock Text="{Binding DatePosted}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" />
<TextBlock Text="{Binding PostText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" />
<TextBlock Text="{Binding UserText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!--Double line list with text wrapping-->
</controls:PanoramaItem>
|
|
|
|
|
You've added two pieces of content to PanoramaItem ; in other words, you've added the StackPanel and the ListBox . I assume you mean for the ListBox to be part of the StackPanel - if so, move it insided the StackPanel tags.
|
|
|
|
|
I wanted two pannels inside my PanoramaItem
The StackPannel will hold fix pre set info
The ListBox will hold a groups of info which should be listed.
somethings like that.
How would I go about doing that, so that is isnt illegal.
Am I using the wrong items?
Thanks
|
|
|
|
|
Put a Grid (Or some other kind of panel) in the PanoramaItem, and put the StackPanel and ListBox in the Grid.
|
|
|
|
|
If you aren't intending to do something like change the visibility of the StackPanel, is there any reason you need two containers? If there is, wrap the StackPanel and ListBox in any of the containers that you want, such as a Grid.
|
|
|
|
|