.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

DynamicData with DomainService ignoring [Readonly] metadata attribute

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :ASP.Net
 

I have recently converted my project to use DD with DomainService, and am surprised to find that the Readonly metadata attribute is being ignored. The Primary Key field 'Id' is now showing up on the insert and edit forms. Has anyone else experienced this issue? Is there a workaround available?




View Complete Post


More Related Resource Links

ReadOnly DateTime attribute stores correct date but only retrieves DateTime.MinValue on Delete

  

Hey everyone,

I have a dynamic data site that stores Event data using LINQ-to-SQL. When someone requests an event, it is first stored as a PendingEvent (which is a child of Event) with a column/attribute called receivedAt, which is [ReadOnly(true)] and which is assigned in InsertEvent as shown.

        partial void InsertEvent(Event instance)
        {
            instance.requestedAt = DateTime.Now;

            SendEmail(instance);

            instance.AddEventToCalendar();

            this.ExecuteDynamicInsert(instance);
        }


This works fine. The event displays with the correct receivedAt date, and it's correct in my database. It shows up just fine on my Display, Edit, and List pages. However, if I try to delete, the receivedAt in the instance (retrieved with my debugger) in my delete function is 01/01/0001 12:00am, also known as DateTime.MinValue. My other dates appear correct.

If I remove "ReadOnly(true)" from the received at, everything works fine. Why won't "ReadOnly" allow me to have a time?
Thanks in advance,

Andrew

Addendum:

I forgot to mention why I care. I can't submit the instance to be deleted because DateTime.MinValue is outside SQL's available datetime, so I get a SQL error. The delete also takes place in a custom dele

chnage data of input type with readonly attribute

  


Hi 
I have webform where i have different input type as text controls with a readonly attribute. I have option to edit the data so through javascript i remove the readonly attribute through javascript, here's the code 
function EditBillAddress()
        {
          

what are the possible values for the UIHint attribute in DynamicData

  

All --

Please help.

I need to know-- what are the possible values for the UIHint attribute in DynamicData?

I am using DotNet 3.5 and VisualStudio 2008.

I know that I can use the name of each *.cs file in the "DynamicData\FieldTemplates\" folder BUT what other names are available?

For instance, in DynamicData Futures, I have seen UIHint[("IntegerSlider")] which I think comes from Ajax BUT there is no such FieldTemplate so where is it getting that resolution?

Please advise.

Thank you.

-- Mark Kamoski


DynamicData With DomainService OnValidate Entity is ignored by the Form

  

DynamicData With DomainService OnValidate Entity is ignored by the Form.

 

The Form(insert,update.aspx) Does not catch the error that I am raising using the method  OnValidation inside the Entity class

throw new ValidationException("Test")

I tried to google it and I got the link below .

http://forums.silverlight.net/forums/p/139985/312670.aspx

 

any Idea 


I am not able to read xml file with XDocument if its Descendants has Attribute xmlns="http://abc.co

  

I am not able to read xml file with XDocument if its Descendants has  Attribute like:-

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root>
  <row ID="1" xmlns="http://www.opentravela.org/OTA/2003/05">
    <var country_name="Caribbean and Rest of the world" city_name="Kingston" flight_category="Economy Class" via="Atlanta" flight_departure="London Heathrow" airline_logo="Delta" adult_fare="Delta" child_fare="660" infant_fare="561" date1="132" date2="2010-08-15" />
  </row>

</root>

I don't know what to do ?

Looking for some help..


NUnit and public static readonly

  

I have an app that I am testing with NUNit.  The project im testing has several helper classes that are created as public static readonly.  When I run the NUnit tests, they all fail with the same error


Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:
SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.
Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:
SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.

I kept getting this error despite stripping out all

Category attribute of user control property does not work correctly in categories tab.

  

Hi,

I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".

[Category("Styles"), DefaultValue(""), Description("The value for formating something.")]
public String MyFormatProperty
{
set { /* the code for set */; }
get { /* the code for get */; }
}

And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.

Does anybody know why? How can I display the category correctly only with set?

Thanks, S.



Compiler Error Message : CS0006: Metadata file 'System.EnterpriseServices.dll' could not be found

  

I get this error when i Debug my web application....

error

I followed these steps.,

  • Ended the aspnet_wp.exe process in the Windows Task Manager
  • Then deleted the application`s folder in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
  • Then started Visual Studio 2008 again

I also rebooted my system but no use....

Plz help !


Make sure that the class defined in this code file matches the 'inherits' attribute, and that it e

  

Here is the page directive for the page that throws the error:

<%
@ Page language="c#" Inherits="University.AspNet.Index" CodeFile="Index.aspx.cs" %>

The code behind file Index.aspx.cs starts like this:

using University.Framework.UI;

namespace University.AspNet

{
      
public partial class Index : University.Framework.UI.HomePage

The code behind is extending this HomePage class, which is in turn an extenstion of another class University.Framework.UI.Page, which extends the System.Web.UI.Page class.

Am I misusing the I

Extreme ASP.NET: Model Validation & Metadata in ASP.NET MVC 2

  

Scott Allen shows how to improve your user input validation with new features coming out in ASP.NET MVC 2 that easily allow validation on both the client and server.

Scott Allen

MSDN Magazine March 2010


"Oslo" Basics: Build Metadata-Based Applications With The "Oslo" Platform

  

We introduce you to "Oslo" and demonstrate how MSchema and MGraph enable you to build metadata-driven apps. We'll define types and values in "M" and deploy them to the repository.

Chris Sells

MSDN Magazine February 2009


Office Development: Manage Metadata with Document Information Panels

  

Here the author uses Document Information Panels in the Microsoft 2007 Office system to manipulate metadata from Office docs for better discovery and management.

Ashish Ghoda

MSDN Magazine April 2008


Security Briefs: Hashing Passwords, The AllowPartiallyTrustedCallers Attribute

  

Keith Brown describes how yo can hash passwords when you want to store them in your own custom database, and when to use the AllowPartiallyTrustedCallers attribure on your assembly.

Keith Brown

MSDN Magazine August 2003


Metadata: Create a Database Schema Repository with Meta Data Services in SQL Server 2000

  

SQL Server 2000 Meta Data Services is a repository technology that stores and manages metadata for SQL Server. Instead of building database schemas over and over, Meta Data Services allows you to freeze an entire schema for use in other projects. You can also use these schemas for training, testing, or debugging. In this article, the authors will review the various components of Meta Data Services and show how it can be programmed using a Visual Basic client, XML, and XSLT. They will also show you how to manage and manipulate your metadata by generating a simple database schema using a SQL Server repository.

Alok Mehta and Ricardo Rodriguez

MSDN Magazine May 2003


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend