.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

how to read a custom dynamic data meta data attribute in a field template

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :ASP.Net
 
All --Please help.I need to know how to read a custom dynamic data meta data attribute in a field template.I know how to do it in a page template because I have a handle to the meta table on the page.However, I do not know how to get a handle to the meta column at run time in a field template.Can you help?Please advise.Thank you.-- Mark Kamoski


View Complete Post


More Related Resource Links

ASP.Net Dynamic Data - DropDownList Field Template with AJAX Cascading DropDown Extension

  
Hi all,   Have spent hours trying to create a Dynamic Data Field Template holding a DropDownList which is extended by the AJAX Cascading DropDown extension. Final form holds multiple cascading dropdown boxes. User selects Country (Land) then Postcodes, Counties (Provincie) are populated. Once postcode is selected then towns (Plaats) are populated.  The problem I am now facing is that the viewstate for the dropdown lists is not being saved/restored after an insert action or custom validation error. So basically the dropdown lists are being reset to their default values. Some code (if missing parts, just ask and I will post them) - Don't mind the code structures etc... needs some refactoring :) Attribute I created:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Data { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] sealed public class CascadingDropDownParametersAttribute : Attribute { //public string TargetControlID; // The ID of the DropDownList to populate. public string Category; // The name of the category this DropDownList represents. public string PromptText; // Optional text to display before the user has selected a value from the DropDownList. public string

Dynamic Data Field template edits - Tooltip text, Dynamic Data Page template edits - field sort

  

I have an ASP.net website build in VB 2010 web dev pro using 4.0 framework.  Its a dynamic data site and I am having some trouble formating some of the field and page canned templates.

Q1: Field Templates - the tooltip code (TextBox1.ToolTip = Column.Description) is within the ascx.vp pages for each of the field templates.  Where can I update each columns description (as the code references) so the tooptip will be column/field specific.  If its not as straight forward as that, I was trying to write an if/else statement because the tooltip code is set at the field type level (decimal, date, etc) and I want it to be column specific.  example;

if column.value = Financial Impact

then  TextBox1.ToolTip = "enter financial impact in whole dollars"

else TextBox1.ToolTip = "next fields tooltip text"

 

<

How do you create a custom BDC data field that allows for multiple selected values?

  
I need help creating a custom data field using the BDC column as a base.  We need to allow for multiple selected values instead of just a single one.  I can't find anything on the net which shows how to do this.

FieldTemplate_Edit to show value when custom meta data is set editable equals false

  
Have a custom FieldTemplate (RadioButtonChooser_Edit.ascx) that shows a radiobuttonlist based on a single character.  Using LinqtoSQL/DynamicData enabled.Example G, F, P  (Good, Fair, Poor).If the custom metadata for a field in the table is set  [Editable(false)]  I get a G, F, or P.  I would like to show the full word when editable is set to false.  Not sure how to approach this.

Read data from BLOB field and write to sharepoint list

  
Hi, I want to read the data from BLOB field and write it into sharepoint list item. Please provide some pointer to archive above objective.   Thanks in Advance.

Set up a validator that compare the value of the current field with an other (using Dynamic Data)

  
Hi! Most of it is in the title : I'd like have a validator on the DateTime_Edit template for example that allows to compare this field with an other DateTime field. My problem is when I am in the DateTime_Edit template of my "master field" (the one I want to check), how can I access to the other field given the architecture of Dynamic Data FieldTemplates? But perhaps I'm not thinking in a good way on this control. Any advice will be welcome. Thanks Raphaelp

Why I won't be using Dynamic Data any more - please read this Microsoft!

  

Well, having spent a few weeks banging my head against a brick wall trying to learn Dynamic Data, I'm giving up. It looks like a great idea, but is fundamentally flawed in at least two respects...

1) The documentation and code samples are pitiful. As has been discussed several times before in this forum, it's almost impossible to learn the technology when the few resources that exist are woefully out of date, and hopelessly inadequate. Sure, you can get a basic DD site up and running quickly, but once you want to start cusotmising - which is essental if you're going to use this for real - you run into problems that just aren't covered anywhere.

I know someone is going to point me to the DD pages on MSDN, but to be blunt, they're no use for learnign anything more than the very basics. MSDN is a great reference resource, but that's only good when you know what you're looking for. It's no use for learning from the ground up. The videos on the www.asp.net site give you a start, but as soon as you want to do anything yourself, you run into problems that just aren't covered in the videos. Some things, like custom filters, just aren't mentioned at all, so how you're supposed to find out how to write your own is beyond me.

The only resource for help is this forum, but as there only seem to be two people here who act

Custom data field

  

Hi,

I have developed a custom data field that stores a lot of data the user creates. It is drawn geometries on map. So I store the geometry, can be hundreds of points in a polyline or polygon, the look of the polygon etc. The problem is when I go to the list view I really dont want to display a huge amount of XML-data just for example a text, Geometry or something. Any ideas how to accomplish this?

Per


display only the date (not time) from a sqlserver date field in dynamic data

  

I have some Date fields defined in my sqlserver database but these display with a time part as well (00:00:00).

how do i esnure that only the date part is displayed and not this redundant time?

John 


Custom Form Field in Collect Data Action doesnot capture multiple users.

  

I have a situation where the department head dynamically assigns the reviewers depending on the document that is uploaded. To capture the reviewers I added a Collect Data Action and a "Reviewers" form field, with type "Person/Group" and checked the following properties

1. Allow selection od People and Groups, 2. Choose from all users and more importantly 3. Allow multiple users

Although I am able to enter multiple users in the form, I am able to retrieve only the first user I entered and the rest just.. disappear!


Dynamic Data. Multiple Custom Pages For The Same Table

  

Hello,

I've just started out my first project using Dynamic Data and I've been running into a series of problems. Dynamic Data doesn't seem to be swimming in documentation. Anyway, my setup is:

  • Visual Studio 2010
  •  .net 4.0
  • Dynamic Data Domain Service Web Application Project Template (I have the RIA Services for ASP .net installed)
  • using an Entity Data Model
  • using a DomainService class
  • ASP .net Membership

There are a couple of things I am trying to achieve:

  1. I have my scaffolding turned on for all the tables. I am using the RequiresRole attribute in order to restric access to some tables. I have understood how you can create a Custom Page Template for a certain table, no problems there. I would like to be able to use the default PageTemplates for lets say the Administrator role and the Custom Page Templates for another role; the idea would be that the Administrator would be able to edit anything in the DB, but the restricted user would receive a Custom Page with only a few actions available. Long story short: is there a way to access both the standard and custom templates?
  2. Related to question number 1: Can I have multiple Custom Page Templates for the same table? I saw someone asking

    assign default value to dynamic data field

      

    Hi,

    I have the script below and I want to apply a default value to the DynamicField StudentId (please see line in bold) below. Can anyone tell me how to do so?

    Thanks,

    Tinac99

     

            <asp:GridView ID="GridViewGuardians"  runat="server" SelectedIndex="1"
                AutoGenerateColumns="false" DataKeyNames="StudentGuardianId" DataSourceID="LinqDataSourceGuardians" ShowHeader="true" ShowFooter="True">
                <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                       <asp:LinkButton  ID="lbInsertGuardianG" runat="server" CommandName="Insert" ValidateionGroup="addValidationGuardian" OnClick="lbInsertGuardianG_Click" >Insert</asp:LinkButton>
                 &

MySql.Data.MySqlClient.MySqlException: Invalid attempt to access a field before calling Read()

  

I'm getting the Following Error.

 Invalid attempt to access a field before calling Read()
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: MySql.Data.MySqlClient.MySqlException: Invalid attempt to access a field before calling Read()

Source Error:


Line 132:        catch (Exception ex)
Line 133:        {
Line 134:            throw (ex);
Line 135:        }
Line 136:        finally
 

 

This error comes sometime and sometimes it doesnot come.

 

I tried to serach on mysql.com the same bug has been posted but no solution.

 


 


Custom display name for a table in dynamic data.

  

I know this has been asked before but I am working in VB and don't know C#. I want to display a custom name for my tables on a dynamic data page. So far I have located the name of the object in my LinqSQL data context which is SectionTable. When displayed I want SectionTable to appear as Section.

I know something should go in the namechange class, but I don't know what! I have got this far:

 

Imports Microsoft.VisualBasic

Imports System.ComponentModel.DataAnnotations

 

<MetadataType(GetType(namechange))>

Partial Public Class SectionTable

End Class

Public Class namechange

End Class

 

Thanks in advance.


Creating Custom Page in Dynamic Data Application

  

To create a custom page I copied the List.Ascx file from the Page templates to DynamicData\CustomPage\"MytableName"

I keep getting the follwing errors mainly in list.aspx.designer

"The type 'L2SDynamicData.List' already contains a definition for GridView1"

"The type 'L2SDynamicData.List' already contains a definition for table1"

"The type 'L2SDynamicData.List' already contains a definition for HeadContent"

"The type 'L2SDynamicData.List' already contains a definition for DynamicDataManager1"

"The type 'L2SDynamicData.List' already contains a definition for UpdatePanel1"

 

There are about 32 of these error types

 

 


How to access the data item(current row) in the field template control?

  

Hi:

     How to access the data item(current row) in the field template control? 


Creating Custom Page in Dynamic Data Application

  

To create a custom page I copied the List.Ascx file from the Page templates to DynamicData\CustomPage\"MytableName"

I keep getting the follwing errors mainly in list.aspx.designer

"The type 'L2SDynamicData.List' already contains a definition for GridView1"

"The type 'L2SDynamicData.List' already contains a definition for table1"

"The type 'L2SDynamicData.List' already contains a definition for HeadContent"

"The type 'L2SDynamicData.List' already contains a definition for DynamicDataManager1"

"The type 'L2SDynamicData.List' already contains a definition for UpdatePanel1"

 

There are about 32 of these error types

 

 


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