Asp.net 配置文件属性未在 Silverlight 应用程序中正确序列化
最近,我一直在摆弄 Silverlight 业务应用程序模板,以让我习惯 silverlight / wcf ria 服务。我遇到了一个奇怪的问题,我不知道如何解决。
到目前为止,我所做的只是创建了一个名为“AvatarURL”的新配置文件属性,基本概念来自此 头像教程,并删除了FriendlyName 属性。不同之处在于,我只是在用户注册时将 AvatarURL 属性设置为默认值 (~/Images/Default.jpg),而不是将字节数组写入文件。因此,在注册阶段,我不会浏览文件或从网络摄像头中提取文件或类似的内容。
我已对 LoginStatus.xaml 等进行了必要的更改,登录后图像不会显示在其占位符中。我单步执行了 LoginStatus.xaml 中的“Authentication_LoggedIn”事件处理程序,由于某种原因,用户的 AvatarURL 属性只是部分值。如果数据库中的值为:“http://localhost:52878/Images/Default.jpg”。当我执行单步调试时得到的值是:“http://localhost:528”。
我已经仔细检查了数据库值并确保它们是正确的。如果我手动输入 XAML 图像的源值(http://localhost:52878/Images/Default.jpg),它显示图像没有问题。这似乎是 silverlight 应用程序和 asp.net 网站项目之间的通信问题。由于我只对解决方案做了微小的更改,并且没有编写任何将两个项目连接在一起的代码,所以我不知道在哪里寻找解决这个问题的方法,有人有任何想法吗?
如果需要,我可以发布一些代码,但它与默认业务模板没有太大区别。
提前致谢。
lately I have been messing around with the Silverlight Business Application template to get me used to silverlight / wcf ria services. I have encountered a wierd issue that I don't know how to solve.
So far all I've done was created a new profile property called "AvatarURL", the basic concept is from this Avatar tutorial, and removed the FriendlyName property. The difference is that I'm just setting the AvatarURL property to default (~/Images/Default.jpg) when the user registers instead of writing a byte array to file. So I'm not browsing for files or pulling from webcam or anything like that during the registration phase.
I've made the necessary changes to LoginStatus.xaml etc, and after logging in the image wouldn't display in it's placeholder. I stepped through the 'Authentication_LoggedIn' eventhandler in LoginStatus.xaml and for some reason the user's AvatarURL property is only a partial value. If the value in the database is: "http://localhost:52878/Images/Default.jpg". The value I get when I do the stepthrough is: "http://localhost:528".
I have double checked the database values and ensured they are correct. If I input the XAML Image's Source value manually (http://localhost:52878/Images/Default.jpg) it displays the image no problem. It appears to be a problem between the communication between the silverlight app and the asp.net website project. Due to the fact I've only made miniscule changes to the solution, and written none of the code that wires the 2 projects together, I have no idea where to look to solve this problem, anyone have any ideas?
I can post some code if necessary but it's not much different than the default business template.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于保存的条目 (http://localhost:528) 正好是 20 个字符长,并且数据库中文本值的常见默认长度是 20 个字符,我猜测大小限制实际上在您的数据库表中,并且输入的值正在被截断。
请检查数据库架构并让我知道情况并非如此。
As the saved entry (http://localhost:528) is exactly 20 characters long and a common default length for text values in databases is 20 characters, I am guessing the size limit is actually in your database table and the values entered are being truncated.
Please check the database schema and let me know of that is not the case.