Telerik Forums
Community Forums Forum
1 answer
132 views
 having a project that uses the telerik dataaccess component to edit or add a new blogpost entity.
It seems it can't access a column(URL) in the database/ORM - We always have been using reverse mapping to autogenerate the classes in the ORM project - then build the ORM.dll file. As indicated below in the code file, the missing property URL is part of the object but for some reason it fails to read that property.
When creating a new record using the openaccessdatasource - onInserting and OnInserted events. it throws out the below error
Exception type: InvalidOperationExceptionException message: A public property with name 'URL' is not available on type 'ORM.Blogpost'. at Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.GetPublicProperty(String name, Type type) at Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.FillPublicPropertiesOnPersistentInstance(IDictionary propertyValues, PersistenceCapable pc, ParameterCollection parameters) at Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteInsert(IDictionary values) at System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) at System.Web.UI.WebControls.FormView.HandleInsert(String commandArg, Boolean causesValidation) at System.Web.UI.WebControls.FormView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) at System.Web.UI.WebControls.FormView.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.FormViewRow.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any ideas on why this might happen?

Here is the form page .aspx and .cs file

<telerik:OpenAccessDataSource ID="BlogpostOpenAccessDataSource" runat="server" ObjectContextProvider="ORM.ObjectScopeProvider1, ORM"TypeName="ORM.Blogpost" Where="CompanyId == @CompanyId AND BlogPostId == @BlogPostId"OnInserted="BlogpostOpenAccessDataSource_Inserted" OnInserting="BlogpostOpenAccessDataSource_Inserting"OnUpdated="BlogpostOpenAccessDataSource_Updated" OnUpdating="BlogpostOpenAccessDataSource_Updating"><WhereParameters><asp:SessionParameter Name="CompanyId" SessionField="companyId" DbType="Guid" /><asp:SessionParameter Name="BlogPostId" SessionField="blogPostId" DbType="Guid" /></WhereParameters></telerik:OpenAccessDataSource>
 Run code snippet
Expand snippet

protected void BlogpostOpenAccessDataSource_Inserting(object sender, OpenAccessDataSourceChangingEventArgs e){ ORM.Blogpost newBlogpost = (ORM.Blogpost)e.Entity; newBlogpost.Url = ""; newBlogpost.CreateDateTime = DateTime.UtcNow; newBlogpost = SetCreateUpdateBlogPost(newBlogpost);}protected void BlogpostOpenAccessDataSource_Inserted(object sender, OpenAccessDataSourceChangedEventArgs e){ ORM.Blogpost newBlogpost = (ORM.Blogpost)e.Entity; blogPostId = newBlogpost.BlogPostId;AddBlogPostMemberType();AddBlogPostCinema();Response.Redirect("~/BlogPost/BlogPost_list.aspx?Information=Successfully Inserted");}protected ORM.Blogpost SetCreateUpdateBlogPost(ORM.Blogpost blogpost){RadDatePicker validStartDateTime = FormView1.FindControl("ValidStartDateTime") as RadDatePicker;RadDatePicker validFinishDateTime = FormView1.FindControl("ValidFinishDateTime") as RadDatePicker;TextBox subjectTextBox = FormView1.FindControl("SubjectTextBox") as TextBox;RadComboBox cmbBlogPostSection = FormView1.FindControl("cmbBlogPostSection") as RadComboBox;TextBox textTextBox = FormView1.FindControl("TextTextBox") as TextBox;CheckBox isStickyCheckBox = FormView1.FindControl("IsStickyCheckBox") as CheckBox;CheckBox isPublicCheckBox = FormView1.FindControl("IsPublicCheckBox") as CheckBox;RadComboBox cmbDestination = FormView1.FindControl("cmbDestination") as RadComboBox; blogpost.ValidStartDateTime = (DateTime)validStartDateTime.SelectedDate; blogpost.ValidFinishDateTime = (DateTime)validFinishDateTime.SelectedDate; blogpost.Subject = subjectTextBox.Text; blogpost.BlogPostSectionId = Int16.Parse(cmbBlogPostSection.SelectedValue); blogpost.Text = textTextBox.Text; blogpost.IsSticky = isStickyCheckBox.Checked; blogpost.IsPublic = isPublicCheckBox.Checked; blogpost.CompanyId = Master.companyId; ORM.Company Company = DAL.DataClasses.Company.GetCompanyObjectById(Master.companyId); blogpost.CountryId = Company.CountryId; blogpost.LanguageId = short.Parse(Company.Country.LanguageId.ToString());//urlif (cmbDestination.SelectedItem.Text == "URL"){TextBox urlTextBox = FormView1.FindControl("URLTextBox") as TextBox; blogpost.Url = urlTextBox.Text;}else{ blogpost.Url = "";}//... some code here for other blogpost fieldsreturn blogpost;}

Here is the generated blogpost.cs file in the ORM project
using System; using System.Collections.Generic; namespace ORM {//Generated by Telerik OpenAccesspublic partial class Blogpost{//The 'no-args' constructor required by OpenAccess.public Blogpost(){}[Telerik.OpenAccess.FieldAlias("blogPostId")]public Guid BlogPostId{ get { return blogPostId; }set { this.blogPostId = value; }}[Telerik.OpenAccess.FieldAlias("authorUserId")]public Guid AuthorUserId{ get { return authorUserId; }set { this.authorUserId = value; }}[Telerik.OpenAccess.FieldAlias("autoPostTypeId")]public int? AutoPostTypeId{ get { return autoPostTypeId; }set { this.autoPostTypeId = value; }}[Telerik.OpenAccess.FieldAlias("blogPostSectionId")]public short BlogPostSectionId{ get { return blogPostSectionId; }set { this.blogPostSectionId = value; }}[Telerik.OpenAccess.FieldAlias("companyId")]public Guid? CompanyId{ get { return companyId; }set { this.companyId = value; }}[Telerik.OpenAccess.FieldAlias("competitionId")]public Guid? CompetitionId{ get { return competitionId; }set { this.competitionId = value; }}[Telerik.OpenAccess.FieldAlias("countryId")]public short? CountryId{ get { return countryId; }set { this.countryId = value; }}[Telerik.OpenAccess.FieldAlias("createDateTime")]public DateTime CreateDateTime{ get { return createDateTime; }set { this.createDateTime = value; }}[Telerik.OpenAccess.FieldAlias("isAutoGenerated")]public bool IsAutoGenerated{ get { return isAutoGenerated; }set { this.isAutoGenerated = value; }}[Telerik.OpenAccess.FieldAlias("isPublic")]public bool IsPublic{ get { return isPublic; }set { this.isPublic = value; }}[Telerik.OpenAccess.FieldAlias("isSticky")]public bool IsSticky{ get { return isSticky; }set { this.isSticky = value; }}[Telerik.OpenAccess.FieldAlias("languageId")]public short LanguageId{ get { return languageId; }set { this.languageId = value; }}[Telerik.OpenAccess.FieldAlias("movieDetailId")]public Guid? MovieDetailId{ get { return movieDetailId; }set { this.movieDetailId = value; }}[Telerik.OpenAccess.FieldAlias("offerId")]public Guid? OfferId{ get { return offerId; }set { this.offerId = value; }}[Telerik.OpenAccess.FieldAlias("pageId")]public Guid? PageId{ get { return pageId; }set { this.pageId = value; }}[Telerik.OpenAccess.FieldAlias("promotionId")]public Guid? PromotionId{ get { return promotionId; }set { this.promotionId = value; }}[Telerik.OpenAccess.FieldAlias("shopId")]public Guid? ShopId{ get { return shopId; }set { this.shopId = value; }}[Telerik.OpenAccess.FieldAlias("subject")]public string Subject{ get { return subject; }set { this.subject = value; }}[Telerik.OpenAccess.FieldAlias("text")]public string Text{ get { return text; }set { this.text = value; }}[Telerik.OpenAccess.FieldAlias("url")]public string Url{ get { return url; }set { this.url = value; }}[Telerik.OpenAccess.FieldAlias("validFinishDateTime")]public DateTime ValidFinishDateTime{ get { return validFinishDateTime; }set { this.validFinishDateTime = value; }}//more properties}} having a project that uses the telerik dataaccess component to edit or add a new blogpost entity.
It seems it can't access a column(URL) in the database/ORM - We always have been using reverse mapping to autogenerate the classes in the ORM project - then build the ORM.dll file. As indicated below in the code file, the missing property URL is part of the object but for some reason it fails to read that property.
When creating a new record using the openaccessdatasource - onInserting and OnInserted events. it throws out the below error
Exception type: InvalidOperationExceptionException message: A public property with name 'URL' is not available on type 'ORM.Blogpost'. at Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.GetPublicProperty(String name, Type type) at Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.FillPublicPropertiesOnPersistentInstance(IDictionary propertyValues, PersistenceCapable pc, ParameterCollection parameters) at Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteInsert(IDictionary values) at System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) at System.Web.UI.WebControls.FormView.HandleInsert(String commandArg, Boolean causesValidation) at System.Web.UI.WebControls.FormView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) at System.Web.UI.WebControls.FormView.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.FormViewRow.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any ideas on why this might happen?

Here is the form page .aspx and .cs file

<telerik:OpenAccessDataSource ID="BlogpostOpenAccessDataSource" runat="server" ObjectContextProvider="ORM.ObjectScopeProvider1, ORM"TypeName="ORM.Blogpost" Where="CompanyId == @CompanyId AND BlogPostId == @BlogPostId"OnInserted="BlogpostOpenAccessDataSource_Inserted" OnInserting="BlogpostOpenAccessDataSource_Inserting"OnUpdated="BlogpostOpenAccessDataSource_Updated" OnUpdating="BlogpostOpenAccessDataSource_Updating"><WhereParameters><asp:SessionParameter Name="CompanyId" SessionField="companyId" DbType="Guid" /><asp:SessionParameter Name="BlogPostId" SessionField="blogPostId" DbType="Guid" /></WhereParameters></telerik:OpenAccessDataSource>
 Run code snippet
Expand snippet

protected void BlogpostOpenAccessDataSource_Inserting(object sender, OpenAccessDataSourceChangingEventArgs e){ ORM.Blogpost newBlogpost = (ORM.Blogpost)e.Entity; newBlogpost.Url = ""; newBlogpost.CreateDateTime = DateTime.UtcNow; newBlogpost = SetCreateUpdateBlogPost(newBlogpost);}protected void BlogpostOpenAccessDataSource_Inserted(object sender, OpenAccessDataSourceChangedEventArgs e){ ORM.Blogpost newBlogpost = (ORM.Blogpost)e.Entity; blogPostId = newBlogpost.BlogPostId;AddBlogPostMemberType();AddBlogPostCinema();Response.Redirect("~/BlogPost/BlogPost_list.aspx?Information=Successfully Inserted");}protected ORM.Blogpost SetCreateUpdateBlogPost(ORM.Blogpost blogpost){RadDatePicker validStartDateTime = FormView1.FindControl("ValidStartDateTime") as RadDatePicker;RadDatePicker validFinishDateTime = FormView1.FindControl("ValidFinishDateTime") as RadDatePicker;TextBox subjectTextBox = FormView1.FindControl("SubjectTextBox") as TextBox;RadComboBox cmbBlogPostSection = FormView1.FindControl("cmbBlogPostSection") as RadComboBox;TextBox textTextBox = FormView1.FindControl("TextTextBox") as TextBox;CheckBox isStickyCheckBox = FormView1.FindControl("IsStickyCheckBox") as CheckBox;CheckBox isPublicCheckBox = FormView1.FindControl("IsPublicCheckBox") as CheckBox;RadComboBox cmbDestination = FormView1.FindControl("cmbDestination") as RadComboBox; blogpost.ValidStartDateTime = (DateTime)validStartDateTime.SelectedDate; blogpost.ValidFinishDateTime = (DateTime)validFinishDateTime.SelectedDate; blogpost.Subject = subjectTextBox.Text; blogpost.BlogPostSectionId = Int16.Parse(cmbBlogPostSection.SelectedValue); blogpost.Text = textTextBox.Text; blogpost.IsSticky = isStickyCheckBox.Checked; blogpost.IsPublic = isPublicCheckBox.Checked; blogpost.CompanyId = Master.companyId; ORM.Company Company = DAL.DataClasses.Company.GetCompanyObjectById(Master.companyId); blogpost.CountryId = Company.CountryId; blogpost.LanguageId = short.Parse(Company.Country.LanguageId.ToString());//urlif (cmbDestination.SelectedItem.Text == "URL"){TextBox urlTextBox = FormView1.FindControl("URLTextBox") as TextBox; blogpost.Url = urlTextBox.Text;}else{ blogpost.Url = "";}//... some code here for other blogpost fieldsreturn blogpost;}

Here is the generated blogpost.cs file in the ORM project
using System; using System.Collections.Generic; namespace ORM {//Generated by Telerik OpenAccesspublic partial class Blogpost{//The 'no-args' constructor required by OpenAccess.public Blogpost(){}[Telerik.OpenAccess.FieldAlias("blogPostId")]public Guid BlogPostId{ get { return blogPostId; }set { this.blogPostId = value; }}[Telerik.OpenAccess.FieldAlias("authorUserId")]public Guid AuthorUserId{ get { return authorUserId; }set { this.authorUserId = value; }}[Telerik.OpenAccess.FieldAlias("autoPostTypeId")]public int? AutoPostTypeId{ get { return autoPostTypeId; }set { this.autoPostTypeId = value; }}[Telerik.OpenAccess.FieldAlias("blogPostSectionId")]public short BlogPostSectionId{ get { return blogPostSectionId; }set { this.blogPostSectionId = value; }}[Telerik.OpenAccess.FieldAlias("companyId")]public Guid? CompanyId{ get { return companyId; }set { this.companyId = value; }}[Telerik.OpenAccess.FieldAlias("competitionId")]public Guid? CompetitionId{ get { return competitionId; }set { this.competitionId = value; }}[Telerik.OpenAccess.FieldAlias("countryId")]public short? CountryId{ get { return countryId; }set { this.countryId = value; }}[Telerik.OpenAccess.FieldAlias("createDateTime")]public DateTime CreateDateTime{ get { return createDateTime; }set { this.createDateTime = value; }}[Telerik.OpenAccess.FieldAlias("isAutoGenerated")]public bool IsAutoGenerated{ get { return isAutoGenerated; }set { this.isAutoGenerated = value; }}[Telerik.OpenAccess.FieldAlias("isPublic")]public bool IsPublic{ get { return isPublic; }set { this.isPublic = value; }}[Telerik.OpenAccess.FieldAlias("isSticky")]public bool IsSticky{ get { return isSticky; }set { this.isSticky = value; }}[Telerik.OpenAccess.FieldAlias("languageId")]public short LanguageId{ get { return languageId; }set { this.languageId = value; }}[Telerik.OpenAccess.FieldAlias("movieDetailId")]public Guid? MovieDetailId{ get { return movieDetailId; }set { this.movieDetailId = value; }}[Telerik.OpenAccess.FieldAlias("offerId")]public Guid? OfferId{ get { return offerId; }set { this.offerId = value; }}[Telerik.OpenAccess.FieldAlias("pageId")]public Guid? PageId{ get { return pageId; }set { this.pageId = value; }}[Telerik.OpenAccess.FieldAlias("promotionId")]public Guid? PromotionId{ get { return promotionId; }set { this.promotionId = value; }}[Telerik.OpenAccess.FieldAlias("shopId")]public Guid? ShopId{ get { return shopId; }set { this.shopId = value; }}[Telerik.OpenAccess.FieldAlias("subject")]public string Subject{ get { return subject; }set { this.subject = value; }}[Telerik.OpenAccess.FieldAlias("text")]public string Text{ get { return text; }set { this.text = value; }}[Telerik.OpenAccess.FieldAlias("url")]public string Url{ get { return url; }set { this.url = value; }}[Telerik.OpenAccess.FieldAlias("validFinishDateTime")]public DateTime ValidFinishDateTime{ get { return validFinishDateTime; }set { this.validFinishDateTime = value; }}//more properties}}
Kevin Cabritit
Top achievements
Rank 1
 answered on 12 May 2017
23 answers
181 views

Hi,
I would like to request to delete my Telerik account. I just tested JustDecompile, but i don't need it anymore.

Thank you

Thomas

Seth
Telerik team
 answered on 09 May 2017
3 answers
82 views
Hello,    
         Please be kind as to remove my profile and complete account as i don't use it 

thank you in advance..
Seth
Telerik team
 answered on 01 May 2017
3 answers
177 views

I was looking at the Windows Forms roadmap (http://www.telerik.com/support/whats-new/winforms/roadmap) and noticed that next build (might) include a new theme based on Material Design.

Is there any preview available for the community? That would be awesome!

 

Dimitar
Telerik team
 answered on 24 Apr 2017
4 answers
200 views

Hi all,

We are evaluating Telerik at the moment and looking to develop web-based apps (ASP.NET MVC) used by internal staff.  We'd also like to know if any of you who have used Telerik to develop internal web-based apps.  That would really help in our evaluation process.

Thanks for your help in advance.

Regards

Stephen

Marin Bratanov
Telerik team
 answered on 24 Apr 2017
3 answers
187 views

Setup:

Firefox: Version  52.0.1 (32-Bit) latest Version

Windows 7

 

Hi,

i have a problem to start / lunch the online demos silverlight from telerik. URL : http://demos.telerik.com/silverlight/

 

I get always this screen:

Welcome to the Silverlight Controls Demo Site.
To view this demo, you need to install Microsoft Silverlight Plugin .
Don’t worry, it’s easy and only takes a second. or Go to Telerik.com Home Page Go to Silverlight Product Overview

 

I already downloaded and installed the newest Silverlight Plugin and get back to the page, but its still asking me to install the Microsoft Silverlight Plugin.

I also tested this with a different Browser (Google Chrome), but it looks like its independent of the Browser.

 

Thank you in advise.

Dinko | Tech Support Engineer
Telerik team
 answered on 04 Apr 2017
0 answers
104 views

Hi,

I'm brand new to this forum and I'm not sure where to post my request.

We've 2 MOSS farms, one for test and one for production.

Some weeks ago the Telerik radeditor just stop to work on the production, you can open the webpart but there's no tool bar and you cannot type anything in the blank box.

We've tried to retract the web part, then remove the solution and re-install the solution and redeployed it to the different sites, we got the same problem.

We've checked if we've differences in the config files between the production and test servers, but everything is identical.

Can you help me on the troubleshooting process?

the Telerik Radeditor version is 5.2.2.0__1f131a624888eeed and I don't think we've a support contract.

Thks in advance for your help

regards

Albert
Top achievements
Rank 1
 asked on 03 Apr 2017
0 answers
108 views

Hi!

While I testing Kendo UI Application for mobile, I discover some incompatibilities with Service Worker in Google Chrome. This concerns the situation when remote view has inline links to *.js: scripts are loaded and evaluate fine, but Service Worker can't respond for this requests - they all time loading from server, but not from SW cache.

The reason is that Kendo UI Application load *.js files from remote views by synchronous XHR requests. But "Synchronous XMLHttpRequest outside of workers is in the process of being removed from the web platform as it has detrimental effects to the end user’s experience." https://xhr.spec.whatwg.org/#sync-warning

More information to learn about: http://stackoverflow.com/questions/35879844/can-service-workers-respond-to-synchronous-xhr-requests

  • Is it possible to change XHR method to asynchronous in that case?
  • Maybe Telerik will be able to change the loading mechanism for inline *.js files from remote views?

I understand that this will require additional logic for the correct order of loading and evaluation of multiple files. But the use of service workers is becoming more urgent and the need for it will increase.

Thanx!

Vladimir
Top achievements
Rank 1
 asked on 31 Mar 2017
5 answers
134 views
We are using telerik RAD editor in our application to edit the content. 

On Mozilla, When there is a table at the bottom of the content, then while editing there is no way to enter another line of text. The keyboard return key doesn't takes the cursor to line below the table.

Also bullets that are added using RAD editor are not displayed in firefox.

Are these limitations or their is a work around for the same?

 

karamveer
Top achievements
Rank 1
 answered on 29 Mar 2017
2 answers
151 views
Pls delete my foum post, http://www.telerik.com/forums/radhtmlchart-with-multiple-series-x-axis-group-labels.
Emi
Top achievements
Rank 1
 answered on 06 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?