C# - Creating Custom Umbraco Data Editor Setting Types?
Feb 17, 2011
I can't seem to find anything on how to edit the data editor settings before umbraco 6.2 (Juno). Is there any simple way, it must be possible. If you don't understand what i mean i want to do the same as [URL]
I am trying to create a custom datatype. The intention being a dropdown list. As of right now, I can access the control I created but no properties or values are showing up within it. Just the blank drop down.
public partial class usercontrols_admin_customDataType_CountryDropDown : System.Web.UI.UserControl, umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor { public string umbracoValue; protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { DataSet ds = new DataSet(); FormFieldBuilder countries = new FormFieldBuilder(); ds = countries.GetAllCountries(); ddCountries.DataSource = ds; ddCountries.DataTextField = ds.Tables[0].Columns["DisplayName"].ToString(); ddCountries.DataValueField = ds.Tables[0].Columns["guiCountryID"].ToString(); ddCountries.DataBind(); } } #region IUsercontrolDataEditor Members public object value { get { return ddCountries.SelectedValue; } set { if (value != null) { ddCountries.SelectedValue = value.ToString(); } } } #endregion }
I've got a custom class for the HTML Editor which adds specific buttons, however I can't figure out how to add specific font names and sizes to the FONTS and FONT SIZE boxes using the code below. I've figured out that simply adding the drop downs for the FONTS and FONT SIZES isn't enough. Once they're added, the specific have to be added.
YES, I have tried adding them using the FONTS and FONTSIZES properties in the HTML markup but after extensive research have determined that it can only be done via code.
i need to create a html editor for use to every page to update the web page content. By right, the html editor only can seen by administrator. So , i should create a custom web part/user control to update different table of database or create a custom editor zone better? how can we do it just like the share point html editor web part?
In my ASP.NET MVC 2 web application, I allow users to create custom input fields of different data types to extend our basic input form. While tricky, building the input form from a collection of custom fields is straight-forward enough.However, I'm now to the point where I want to handle the posting of this form and I'm not certain what the best way to handle this would be. Normally, we'd use strongly-typed input models that get bound from the various statically-typed inputs available on the form. However, I'm at a loss for how to do this with a variable number of input fields that represent different data types.A representative input form might look something like:
My date field: [ date time input control ] My text field: [ text input field ] My file field: [ file upload control ] My number field: [ numerical input control ] My text field 2: [text input field ] etc...
Ideas I've thought about are:Sending everything as strings (except for the file inputs, which would need to be handled specially).Using a model with an "object" property and attempting to bind to that (if this is even possible).Sending a json request to my controller with the data encoded properly and attempting to parse that.Manually processing the form collection in my controller post action - certainly an option, but I'd love to avoid this.Has anyone tackled an issue like this before? If so, how did you solve it?Update:My "base" form is handled on another input area all together, so a solution doesn't need to account for any sort of inheritence magic for this. I'm just interested in handling the custom fields on this interface, not my "base" ones.Update 2:Thank you to ARM and smartcaveman; both of you provided good guidance for how this could be done. I will update this question with my final solution once its been implemented.
I have Web App. in that One note control and one textbox,when I run the app then cursor focus the note but I want to focus on textbox,I have use Focus property but their is no work
I'm finding my self with the problem that if I do not show the Template for a "complex" object I have in the main view object I still get the errors in the summary. How do i get around this?
I've got a model with say:
->Persons (has its own editor template) ->Pets(has its own editor template)
In the create view I show each one depending if they are not null. But when I try to validate HouseType and say I have Persons not null and pets is null. I get errors of validation for pets.
ClassA is a custom class generated from a "type" in oracle database. ClassB is a custom class generated from a "table of type ClassA" in Oracle database.
The exposed service includes a login procedure which gets a username as input parameter and returns object B. Debugging the login procedure I can see that the data is retrieved from the database but not printed in the wsdl..
[Code]....
My ClassB definition is as follows:
[XmlInclude(typeof(ClassB))] public class ClassB : INullable, IOracleCustomType, IXmlSerializable ...
similar definition holds for ClassA as well. the generated wsdl is :
<? xml version="1.0" encoding="utf-8" ?> <ClassB xmlns="http://tempuri/org" />
I'll use Customer and Addresses as an example rather than explain my real objects. Say I have a repeater bound to a collection of Customers and one of the properties of Customer is an array of addresses. How do I bind to the addresses property? I don't even need to display this information I just want to use it in the Repeaters ItemDataBound event. So I tried to bind a hiddenField to the addresses property but all I get for every customer in the hiddenfields value is an empty array of addresses.
I am creating a custom control by inheriting a server control, say LinkButton. There are properties like "BorderColor" available in LinkButton. Let's say, I don't want this particular property to be available when I create an instance of the custom control.
I want to completely hide this particular property (I don't want to override it but disable it.)
so after a short talk with some people around ASP.NET MVC forum I took a huge step and chose to create my own Custom Membership Data provider.. so I logged into sweet google and started searching , it doesnt look that hard and seems totally possible for me , that's what i thought...
So now I opened visual studio , and started to think on few things .. So before I would start typing code , I would like to ask those questionsSo i would know better
1. when I build an SQL object , or XML or w.e object, how do I know which fields I need for my table ? should i just copy them from aspnetdb or is there somewhere it is written?
2. how the heck do I copy lines from webconfig ? and should I get those lines like "reset password" from web config or not?
3. I saw some parameters in "create User" called providerKey or something like that, and also MembershipState ? what exacly are those ?
4. last question: the functions get username , and password and stuff like that , but what If i want to create my own User Entity , is there a way to change what the function gets ? or should i just make another class that get my custom UserEntity and let the first class to send her the userentity as repository ?
I recently got a form to work with the "HttpContext.Current.User.Identity.Name.ToString" String. That basic idea was I needed a hidden form field so that each record submitted would include the UserName of the user logged in to the membership. However, whenever I try to create a custom query for the gridview, it doesn't submit. how I would go about doing this? Code as below:
I am trying to create a chart with three x-axis labels where the chart series x-value member is a date. That is, each data point is a day returned from a SQL Server table. The first label row is to be the day component, the second label row the month name component and the third label row the year. The returned dataset can be from any time period and of varying length. It needs to look like below so each day can be seen but the bigger picture is also shown.
x-axis label(0): 26 27 28 29 30 31 1 2 3 4 5 6
x-axis label(1): March April
x-axis label(2): 2010
I can set the first row using the design time properties as such
[Code]....
I am not sure how to create the next to custom labels at runtime. I have gone through the options using Add(Double, DateTimeIntervalType, Double, Double, String, Int32, LabelMarkStyle) and Add(Double, DateTimeIntervalType, String, Int32, LabelMarkStyle) but I just cannot get them to appear in the chart label.
I tried the other method [Code]....
however could not find how to set the DateTimeIntervalType on the CustomLabel object.
There was nothing in the ChartSamples and I am not even sure if it can be done.
Whilst my validation is successful/fine with this control (ValidationMessageFor works) I have been unable to find how to highlight the control when validation fails (e.g. with a TextBoxFor the textbox border goes red if validation fails)
Does anyone know how I can add this behaviour with a custom editor template?
As the subject may be a bit vauge as i found it hard summing up what i was after when searching on google here is an example of what i mean:
[Code]....
Im basically trying to write my own simple tag parser, so i can allow people to enter a certain amount of tags like shown above and i would parse them and turn them into html outputs... and i couldnt find the right terms to search for on google, so i thoughti would see if anyone here knows of any good tutorials on the subject, or what specifically i should search for to sum up what im after.
I have an application that allows admins to add types such as document types and training types that are in seperate tables with a foreign key in a transaction table.
When structuring my class I decided to go with an abstract-like pattern (without the factory methods though). So I have a Type abstract class that defines my Save, Delete, and GetList methods. I have a training type class that inherits this class. The thing is all types have 3 main properties - defined in the abstract base - but have different source tables and thus different store procedures in my DbCommand object. So basically I repeat setting up the same parameters on all the derived classes. I would like to implement the common stuff in the base but I am getting thrown off by the difference in data sources.
I want to customize Ajax HTML Editor's insert link function so I derived a custom button from OkCancelPopupButton and related popup from OkCancelAttachedTemplatePopup, but the button texts don't appear. See picture below (CĂm: URL, MegjelenĹ‘ szöveg: Display text).