欣静赏悦 2011-01-28 16:55
System.Reflection.TargetInvocationException: [Async_ExceptionOccurred]
参数:
调试资源字符串不可用。
请教下,这个是什么问题,我没有跨域,部署在SharePoint上,连接SQL。代码单元测试通过的。
谢谢
大树牛 2009-07-22 10:38
靠,我知道了,在linq to sql 自动生成的类里面修改一下,加上DataContract 和 DataMember,就可以了。(lilop@126.com)
Amar-Yao 2009-07-22 10:21
你是银客帝国的吧,我是Amar
好像已经告诉过你了
大树牛 2009-07-22 10:18
那如何才能生成DataContract呢?
Amar-Yao 2009-07-21 16:20
楼上的查清问题在说话,
你的错误应该是Linq to sql实体类导致
Linq to sql实体类不能直接作为DataContract的
大树牛 2009-07-21 16:12
大侠,照你的做了,没解决问题
我的项目:
建立 web site 项目
然后 通过linq to sql 连接库,取得实体
然后 用wcf
在 xaml里面 就只放置了 datagrid,
,发布,接着报错
如果web项目上iis上就出问题了,具体错误:
throw new Error("Unhandled Error in Silverlight Application 操作过程中出现异常,结果无效。有关异常的详细信息,请查看 InnerException。 位于 System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()\n 位于 SilverlightApplication1.ServiceReference1.DoWorkCompletedEventArgs.get_Result()\n 位于 SilverlightApplication1.MainPage.c_DoWorkCompleted(Object sender, DoWorkCompletedEventArgs e)\n 位于 SilverlightApplication1.ServiceReference1.Service1Client.OnDoWorkCompleted(Object state)");
seeker 2009-05-20 08:41
@Amar-Yao
该异常出现,普遍是当前绑定值不存在所引发的。如果能提供你异常的代码,更容易分析。
Amar-Yao 2009-05-19 12:56
谢谢,解决了我的大问题
还想问一下我的控件模版中有Source="{Binding ProductImage}",这样的绑定设置,其他图片都是些死在界面的,为什么还有Sys.InvalidOperationException: ImageError error #4001 in control 'Xaml1': AG_E_NETWORK_ERROR” 异常。
这个错误,查看源代码显示Asp.Net Ajax框架未加载
伯乐族人 -- www.ibole.cn 2009-01-22 12:43
好文章,你的文章已经被伯乐族收藏。你也可以通过伯乐族提交你的文章,这样有更多人能关注到你的文章。
seeker 2009-01-03 09:15
谢谢大家,也谢谢TerryLee。
关键问题在于绑定发生在设置DataContext之前,所以Image路径还没有设置成你期望的值。
具体源代码修改如下:
在xaml中去掉 Source="{Binding ProductImage}"
private void ResponseReady(IAsyncResult asyncResult)
{
WebRequest request = asyncResult.AsyncState as WebRequest;
WebResponse response = request.EndGetResponse(asyncResult);
using (Stream responseStream = response.GetResponseStream())
{
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(ProductList));
ProductList productList = jsonSerializer.ReadObject(responseStream) as ProductList;
new Thread(() => {
mygrid.Dispatcher.BeginInvoke(
() =>
{
mygrid.DataContext = productList.Products[0];
Binding binding = new Binding("ProductImage");
rect.SetBinding(Image.SourceProperty, binding);
}
);
}).Start();
}
seeker 2008-12-31 16:16
@TerryLee
如果是Source属性Binding问题的话,为什么我在用以下代码进行绑定也可以呢?
<Image x:Name="rect" Stretch="Fill" Canvas.Left="150" Canvas.Top="130" Source="{Binding ProductImage}"
</Image> 这边绑定不变。服务端代码改成:
Product p = new Product();
p.PinMing = "test";
p.PinPai = "abb";
p.Integral = 20;
p.Price = 20.65;
p.Sort1 = "test";
p.Sort2 = "test";
p.Sort3 = "test";
p.ProductImage = "images/2008-12-16_140756.jpg";
mygrid.DataContext = p;
这样就可以,在页面重新加载不会出现异常。但用WebRequest去请求,就会出现该异常。虽然服务端实现不一样,但两者都是动态绑定image.为什么?
TerryLee 2008-12-31 13:03
问题出在这段代码:
<Canvas x:Name="LayoutRoot" >
<Image x:Name="rect" Stretch="Fill" Canvas.Left="150" Canvas.Top="130" Source="{Binding ProductImage}"
MouseLeftButtonDown="rect_MouseLeftButtonDown_1"
MouseLeftButtonUp="rect_MouseLeftButtonUp_1"
MouseMove="rect_MouseMove_1">
<Image.RenderTransform>
<ScaleTransform x:Name="ZoomScaleTransform"></ScaleTransform>
</Image.RenderTransform>
</Image>
</Canvas>
设置Source属性Binding有问题,你再查一下。
seeker 2008-05-28 20:32
@zpap
是啊,能在支持FireFox就更好了。@zpap你有没有更好的解决方案呢?
zpap 2008-05-28 18:44
只能支持 Ie 应该不够通用吧
seeker 2008-05-18 01:33
@xxasa
拖拽效果已经实现,等下次有时间,我整理下,也公布实现代码,我们一起交流下。
xxasa 2008-05-17 21:47
最好能拖动,那就好多了
飞哥 2008-03-07 15:12
不错,哥顶一个
seeker 2008-02-26 12:58
@老Q
谢谢老Q,你给这个例子很好,正在研究中.......同时也多谢大家的支持.
JustDI 2008-02-26 10:04
收藏~~,有时间再过来学习..
猪怕壮 2008-02-26 09:06
占位学习