Search Results

Search found 6175 results on 247 pages for 'parental controls'.

Page 11/247 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • CommandBinding broken in inner Custom Control when nesting two Custom Controls of the same type.

    - by Fredrik Eriksson
    I've done a Custom Control in form of a GroupBox but with an extra header which purpose is to hold a button or a stackpanel with buttons at the other side. I've added the a Dependency Property to hold the extra header and I've connected the customized template. Everything works fine until I put one of these controls in another one. Now the wierd stuff begins(at least in my eyes xP), the command binding in the inner control simply isn't set. I tried to use Snoop to gather some data, the see if the inherits is broken and when I clicked on the buttons which isn't doing what I want it to, boom, breakpoint triggered. So in some wierd way the Command isn't set until something that I don't know what it is, happens, which snoops triggers. I've also tried to put the buttons in the regular Header property and that works fine, but not with my own made. I could just switch places with them to make it like I want but now I'm curious to know where the problem lies... Now I wonder, what can I've missed? The control class: public class TwoHeaderedGroupBox : GroupBox { static TwoHeaderedGroupBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TwoHeaderedGroupBox), new FrameworkPropertyMetadata(typeof(TwoHeaderedGroupBox))); } public static DependencyProperty HeaderTwoProperty = DependencyProperty.Register("HeaderTwo", typeof(object), typeof(TwoHeaderedGroupBox), new FrameworkPropertyMetadata()); public object HeaderTwo { get { return (object)GetValue(HeaderTwoProperty); } set { SetValue(HeaderTwoProperty, value);} } } And here is the Template (which by the way is created by blend from the beginning): <ControlTemplate TargetType="{x:Type Controls:TwoHeaderedGroupBox}"> <Grid SnapsToDevicePixels="true"> <Grid.ColumnDefinitions> <ColumnDefinition Width="6"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="6"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> <RowDefinition Height="6"/> </Grid.RowDefinitions> <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="4" Grid.Column="0" CornerRadius="4" Grid.Row="1" Grid.RowSpan="3"/> <Border x:Name="Header" Grid.Column="1" Padding="3,1,3,0" Grid.Row="0" Grid.RowSpan="2" VerticalAlignment="Center"> <ContentControl Content="{TemplateBinding Header}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> </Border> <ContentPresenter Grid.ColumnSpan="2" Grid.Column="1" Margin="{TemplateBinding Padding}" Grid.Row="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" CornerRadius="4" Grid.Row="1" Grid.RowSpan="3"> <Border.OpacityMask> <MultiBinding ConverterParameter="7" Converter="{StaticResource BorderGapMaskConverter}"> <Binding ElementName="Header" Path="ActualWidth"/> <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/> <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/> </MultiBinding> </Border.OpacityMask> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3"> <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/> </Border> </Border> <Border x:Name="HeaderTwo" Grid.Column="2" Padding="3,5,3,5" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Right"> <ContentControl Content="{TemplateBinding HeaderTwo}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" DataContext="{TemplateBinding DataContext}"/> </Border> </Grid> </ControlTemplate>

    Read the article

  • Iframe vs dynamically loading web user controls

    - by kevin
    I need some advice on techniques to perform page redirect in asp.net. Which one is more recommended to use in asp.net? Dynamically changed the src of the Iframe to difference aspx. Dim frame As HtmlControl = CType(Me.FindControl("frameMain"), HtmlControl) frame.Attributes("src") = "page1.aspx" Dynamically load web user controls to an asp:panel. panelMain.Controls.Clear() panelMain.Controls.Add(LoadControl("WebControl/page1.ascx")) (convert all aspx page to web user controls)

    Read the article

  • Iframe Vs Dynamiclly load web user controls

    - by kevin
    I need some advice on technique to perform page redirect in asp.net. Which one is more recommended to use in asp.net? Dynamically changed the src of the Iframe to difference aspx. Dim frame As HtmlControl = CType(Me.FindControl("frameMain"), HtmlControl) frame.Attributes("src") = "page1.aspx" Dynamically load web user controls to an asp:panel. panelMain.Controls.Clear() panelMain.Controls.Add(LoadControl("WebControl/page1.ascx")) (convert all aspx page to web user controls)

    Read the article

  • How create a fullscreen view of a group of controls, that belongs to a tabpage

    - by voodoomsr
    Hi all, i would like to know what is the correct way to create a fullscreen view of a tabpage control. This page has other controls, and that controls has various events that are subscribed. I was trying creating a new fullscreen form and copy all controls of the tabs to that form, but with this approach i need to resubscribe every control to the corresponding handler. If i only add the references the subscription remains but when the fullscreen form is close also the referenced copied controls are lost.

    Read the article

  • Allow IExtenderProvider control to attach to controls on a UserControl

    - by Justin
    VB.NET 2.0 Framework I developed a control that implements IExtenderProvider in order to attach to controls and display a form for translating of the text of that control. This works great on regular controls on the form but the IExtenderProvider is not attaching to controls on UserControls, which makes sense. Is it possible to modify the UserControls or my IExtenderProvider control to enable it to attach to controls on a UserControl? Thanks!

    Read the article

  • What's the thought behind Children and Controls properties in WPF?

    - by Mathias Lykkegaard Lorenzen
    I don't know if this should go on Programmers, but I thought it was relevant here. Being a skilled WPF programmer myself, I often wonder what people were thinking when they designed WPF in terms of naming conventions. Why would you sometimes have a property called Children for accessing the children of the control, and then sometimes have an equivalent property, just called Controls instead? What were they thinking here? Another example is the Popup control. Instead of a Content property, it has a Child property. Why would you do that? To me that's just confusing. So I'm wondering if there's a logical reason for it, which would probably also help me understand what the properties are called next time I need to do some speed-programming. If there's no reason behind it, then all I can say is WAT.

    Read the article

  • jwplayer embedded with recent flash with html5 back end cant hide controls or add autoplay and loop

    - by Daniel Redwood
    Hey all, After the unfortunate realization that Firefox is just not going to play nice with an embedded HTML5 video with my server set up, I've decided to go the JW Player route, since it's compatible with iPads and iPhones. I can get the file to show up on my page, but it's big and heavy. I would like for it to be just the video, no controls. Autoplay and on loop. Can you help me out? Here's the code... <div id="container">Loading the player ...</div> jwplayer("container").setup({ flashplayer: "jwplayer/player.swf", file: "Video/fernando.m4v", height: 520, width: 780, }); <script type='text/javascript' src='swfobject.js'></script>

    Read the article

  • Cross Theaded Calls - Many controls Heavy GUI Application after .net 1.1 2.0 upgrade- best way ??

    - by keepsmilinyaar
    I have recently upgraded a .net1.1 solution to .net2.0. AS this is a very heavy GUI appilcation with loads of controls and many multithreaded operations that update the GUI. While these operations worked seamlessly in .net1.1 it is throwing up Cross Threaded Illegal operations after the upgrade. Considering the fact that tehre are numerous grids, buttons and status labels that need to be updated via these multi threaded operations, I decided to code for checking the InvokeRequired solution, however doing that for every control would probably not be the best way to go about it. I was wondering if you could suggest a better way of how I can go about it or propose any OOPS based class structure that I could code around to make the code look better. Please do let me know if my question is unclear. Thanks in advance

    Read the article

  • Recommendations for C# controls that can be used to create a hierarchical list of prioritised items?

    - by Mendokusai
    I need to be able to display and edit a hierarchical list of tasks in a C# app. It can either be a Windows form app, or ASP.NET. Basically, I want similar behaviour to the way Microsoft Project handles tasks. The control would need to: 1) Maintain a list of items made up of several fields 2) Each item can have a number of children (at least 3 levels of nesting) 3) It needs to be very easy to change the parents/children of an item 4) It needs to be very easy to edit the fields (as fast as changing cells in Excel) 5) It needs to be very easy to reorder the items by dragging and dropping or cut and paste 6) If I can easily connect the control to a database, even better Anyone got any recommendations for controls for me to look at?

    Read the article

  • How do I create custom Controls for my VS2005 toolbox?

    - by end-user
    Ok, this question might more about design theory. I have successfully created controls that show up in my toolbox, so I'm pretty sure I have the process right. Also, my "AutoToolboxPopulate" is set to true, so things are showing up as I create them. My question is this: I'm sub-classing a native Control for specialized use. When I derive my class from an exposed concrete class, such as BulletedList, my custom Control appears in my Toolbox. However, when I drop it back to the parent, such as ListControl, my Control is not listed (actually it's grayed out when I "List All"). What am I missing?

    Read the article

  • Access Master Page Controls II

    - by Bunch
    Here is another way to access master page controls. This way has a bit less coding then my previous post on the subject. The scenario would be that you have a master page with a few navigation buttons at the top for users to navigate the app. After a button is clicked the corresponding aspx page would load in the ContentPlaceHolder. To make it easier for the users to see what page they are on I wanted the clicked navigation button to change color. This would be a quick visual for the user and is useful when inevitably they are interrupted with something else and cannot get back to what they were doing for a little while. Anyway the code is something like this. Master page: <body>     <form id="form1" runat="server">     <div id="header">     <asp:Panel ID="Panel1" runat="server" CssClass="panelHeader" Width="100%">        <center>            <label style="font-size: large; color: White;">Test Application</label>        </center>       <asp:Button ID="btnPage1" runat="server" Text="Page1" PostBackUrl="~/Page1.aspx" CssClass="navButton"/>       <asp:Button ID="btnPage2" runat="server" Text="Page2" PostBackUrl="~/Page2.aspx" CssClass="navButton"/>       <br />     </asp:Panel>     <br />     </div>     <div>         <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>         <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">         </asp:ContentPlaceHolder>     </div>     </form> </body> Page 1: VB Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load     Dim clickedButton As Button = Master.FindControl("btnPage1")     clickedButton.CssClass = "navButtonClicked" End Sub CSharp protected void Page_Load(object sender, EventArgs e) {     Button clickedButton;     clickedButton = (Button)Master.FindControl("btnPage1");     clickedButton.CssClass = "navButtonClicked"; } CSS: .navButton {     background-color: White;     border: 1px #4e667d solid;     color: #2275a7;     display: inline;     line-height: 1.35em;     text-decoration: none;     white-space: nowrap;     width: 100px;     text-align: center;     margin-bottom: 10px;     margin-left: 5px;     height: 30px; } .navButtonClicked {     background-color:#FFFF86;     border: 1px #4e667d solid;     color: #2275a7;     display: inline;     line-height: 1.35em;     text-decoration: none;     white-space: nowrap;     width: 100px;     text-align: center;     margin-bottom: 10px;     margin-left: 5px;     height: 30px; } The idea is pretty simple, use FindControl for the master page in the page load of your aspx page. In the example I changed the CssClass for the aspx page's corresponding button to navButtonClicked which has a different background-color and makes the clicked button stand out. Technorati Tags: ASP.Net,CSS,CSharp,VB.Net

    Read the article

  • Membership in ASP.Net applications - part 1

    - by nikolaosk
    So far in all my posts, I have never mentioned anything about how to implement authentication/authorisation mechanisms in a web site. In all our professional web applications we do need some sort of mechanism to verify who are users are and what privileges have in our site. This is the first post in a series of posts investigating how to implement membership (authentication+authorisation) in ASP.Net applications. We will look into the built-in web server security controls.We will look at the built...(read more)

    Read the article

  • WPF - Grid - updating Row and Column number attached properties on child controls each time a new Ro

    - by ig105
    I have a WPF Grid with a XAML similar to this: <Grid width=200 Height=200 > <Grid.ColumnDefinitions > <ColumnDefinition Width="1*" /> <ColumnDefinition Width="2*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" MinHeight="24" /> </Grid.RowDefinitions> <TextBlock Text="Name" Grid.Row="0" Grid.Column="0"/> <TextBox Grid.Row="0" Grid.Column="1" /> <TextBlock Text="Age" Grid.Row="1" Grid.Column="0"/> <TextBox Grid.Row="1" Grid.Column="1" /> </Grid> I need to add a new row in between existing 2 rows of data, but my worry is that when I add a new row, I will need to manually update Grid.Row attached property in each of the controls that appear in rows below the newly added row. Is there a smarter way of doing this? may be to set Row/Column numbers relative to adjacent Rows/Columns ? Cheers.

    Read the article

  • HTML 5 video custom controls

    - by pygorex1
    Like many web developers I'm looking forward to streaming video that utilizes the new HTML 5 <video> tag. Browser support definitely isn't wide enough yet, so using a Flash/SWF fallback is a must. This got me thinking: in Flash it's possible to highly customize the playback controls (pause, play, stop, seek, volume, etc.) in HTML 5?. What options are there for customizing the glyphs, icons and colors of video controls? Is Javascript required? For instance the following page renders different controls depending on the browser - tested using FF3.5, Chrome and Safari: http://henriksjokvist.net/examples/html5-video/ It would be really awesome to customize and standardize controls across browsers and even match the Flash controls used by older browsers.

    Read the article

  • Methodology for designing user controls

    - by zSysop
    Hi all, I want to able to create reusable user controls within my web app and i'm wondering on how to go about doing so. Should a user controls properties be visible to a form that's using it? What's the best way to go about loading the controls on the user control from the form thats using it? Should there be a public method within the control that allows you to load it from an external form or should the user control be loaded in the page load event Is it okay to nest user controls within user controls? etc... Thanks for any advice

    Read the article

  • Knockout with ASP.Net MVC2 - HTML Extension Helpers for input controls

    - by Renso
    Goal: Defining Knockout-style input controls can be tedious and also may be something that you may find obtrusive, mixing your HTML with data bind syntax as well as binding your aspx, ascx files to Knockout. The goal is to make specifying Knockout specific HTML tags easy, seamless really, as well as being able to remove references to Knockout easily. Environment considerations: ASP.Net MVC2 or later Knockoutjs.js How to:     public static class HtmlExtensions     {         public static string DataBoundCheckBox(this HtmlHelper helper, string name, bool isChecked, object htmlAttributes)         {             var builder = new TagBuilder("input");             var dic = new RouteValueDictionary(htmlAttributes) { { "data-bind", String.Format("checked: {0}", name) } };             builder.MergeAttributes(dic);             builder.MergeAttribute("type", @"checkbox");             builder.MergeAttribute("name", name);             builder.MergeAttribute("value", @"true");             if (isChecked)             {                 builder.MergeAttribute("checked", @"checked");             }             return builder.ToString(TagRenderMode.SelfClosing);         }         public static MvcHtmlString DataBoundSelectList(this HtmlHelper helper, string name, IEnumerable<SelectListItem> selectList, String optionLabel)         {             var attrProperties = new StringBuilder();             attrProperties.Append(String.Format("optionsText: '{0}'", name));             if (!String.IsNullOrEmpty(optionLabel)) attrProperties.Append(String.Format(", optionsCaption: '{0}'", optionLabel));             attrProperties.Append(String.Format(", value: {0}", name));             var dic = new RouteValueDictionary { { "data-bind", attrProperties.ToString() } };             return helper.DropDownList(name, selectList, optionLabel, dic);         }         public static MvcHtmlString DataBoundSelectList(this HtmlHelper helper, string name, IEnumerable<SelectListItem> selectList, String optionLabel, object htmlAttributes)         {             var attrProperties = new StringBuilder();             attrProperties.Append(String.Format("optionsText: '{0}'", name));             if (!String.IsNullOrEmpty(optionLabel)) attrProperties.Append(String.Format(", optionsCaption: '{0}'", optionLabel));             attrProperties.Append(String.Format(", value: {0}", name));             var dic = new RouteValueDictionary(htmlAttributes) {{"data-bind", attrProperties}};             return helper.DropDownList(name, selectList, optionLabel, dic);         }         public static String DataBoundSelectList(this HtmlHelper helper, String options, String optionsText, String value)         {             return String.Format("<select data-bind=\"options: {0},optionsText: '{1}',value: {2}\"></select>", options, optionsText, value);         }         public static MvcHtmlString DataBoundTextBox(this HtmlHelper helper, string name, object value, object htmlAttributes)         {             var dic = new RouteValueDictionary(htmlAttributes);             dic.Add("data-bind", String.Format("value: {0}", name));             return helper.TextBox(name, value, dic);         }         public static MvcHtmlString DataBoundTextBox(this HtmlHelper helper, string name, string observable, object value, object htmlAttributes)         {             var dic = new RouteValueDictionary(htmlAttributes);             dic.Add("data-bind", String.Format("value: {0}", observable));             return helper.TextBox(name, value, dic);         }         public static MvcHtmlString DataBoundTextArea(this HtmlHelper helper, string name, string value, int rows, int columns, object htmlAttributes)         {             var dic = new RouteValueDictionary(htmlAttributes);             dic.Add("data-bind", String.Format("value: {0}", name));             return helper.TextArea(name, value, rows, columns, dic);         }         public static MvcHtmlString DataBoundTextArea(this HtmlHelper helper, string name, string observable, string value, int rows, int columns, object htmlAttributes)         {             var dic = new RouteValueDictionary(htmlAttributes);             dic.Add("data-bind", String.Format("value: {0}", observable));             return helper.TextArea(name, value, rows, columns, dic);         }         public static string BuildUrlFromExpression<T>(this HtmlHelper helper, Expression<Action<T>> action)         {             var values = CreateRouteValuesFromExpression(action);             var virtualPath = helper.RouteCollection.GetVirtualPath(helper.ViewContext.RequestContext, values);             if (virtualPath != null)             {                 return virtualPath.VirtualPath;             }             return null;         }         public static string ActionLink<T>(this HtmlHelper helper, Expression<Action<T>> action, string linkText)         {             return helper.ActionLink(action, linkText, null);         }         public static string ActionLink<T>(this HtmlHelper helper, Expression<Action<T>> action, string linkText, object htmlAttributes)         {             var values = CreateRouteValuesFromExpression(action);             var controllerName = (string)values["controller"];             var actionName = (string)values["action"];             values.Remove("controller");             values.Remove("action");             return helper.ActionLink(linkText, actionName, controllerName, values, new RouteValueDictionary(htmlAttributes)).ToHtmlString();         }         public static MvcForm Form<T>(this HtmlHelper helper, Expression<Action<T>> action)         {             return helper.Form(action, FormMethod.Post);         }         public static MvcForm Form<T>(this HtmlHelper helper, Expression<Action<T>> action, FormMethod method)         {             var values = CreateRouteValuesFromExpression(action);             string controllerName = (string)values["controller"];             string actionName = (string)values["action"];             values.Remove("controller");             values.Remove("action");             return helper.BeginForm(actionName, controllerName, values, method);         }         public static MvcForm Form<T>(this HtmlHelper helper, Expression<Action<T>> action, FormMethod method, object htmlAttributes)         {             var values = CreateRouteValuesFromExpression(action);             string controllerName = (string)values["controller"];             string actionName = (string)values["action"];             values.Remove("controller");             values.Remove("action");             return helper.BeginForm(actionName, controllerName, values, method, new RouteValueDictionary(htmlAttributes));         }         public static string VertCheckBox(this HtmlHelper helper, string name, bool isChecked)         {             return helper.CustomCheckBox(name, isChecked, null);         }          public static string CustomCheckBox(this HtmlHelper helper, string name, bool isChecked, object htmlAttributes)         {             TagBuilder builder = new TagBuilder("input");             builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));             builder.MergeAttribute("type", "checkbox");             builder.MergeAttribute("name", name);             builder.MergeAttribute("value", "true");             if (isChecked)             {                 builder.MergeAttribute("checked", "checked");             }             return builder.ToString(TagRenderMode.SelfClosing);         }         public static string Script(this HtmlHelper helper, string script, object scriptAttributes)         {             var pathForCRMScripts = ScriptsController.GetPathForCRMScripts();             if (ScriptOptimizerConfig.EnableMinimizedFileLoad)             {                 string newPathForCRM = pathForCRMScripts + "Min/";                 ScriptsController.ServerPathMapper = new ServerPathMapper();                 string fullPath = ScriptsController.ServerMapPath(newPathForCRM);                 if (!File.Exists(fullPath + script))                     return null;                 if (!Directory.Exists(fullPath))                     return null;                 pathForCRMScripts = newPathForCRM;             }             var builder = new TagBuilder("script");             builder.MergeAttributes(new RouteValueDictionary(scriptAttributes));             builder.MergeAttribute("type", @"text/javascript");             builder.MergeAttribute("src", String.Format("{0}{1}", pathForCRMScripts.Replace("~", String.Empty), script));             return builder.ToString(TagRenderMode.SelfClosing);         }         private static RouteValueDictionary CreateRouteValuesFromExpression<T>(Expression<Action<T>> action)         {             if (action == null)                 throw new InvalidOperationException("Action must be provided");             var body = action.Body as MethodCallExpression;             if (body == null)             {                 throw new InvalidOperationException("Expression must be a method call");             }             if (body.Object != action.Parameters[0])             {                 throw new InvalidOperationException("Method call must target lambda argument");             }             // This will build up a RouteValueDictionary containing the controller name, action name, and any             // parameters passed as part of the "action" parameter.             string name = body.Method.Name;             string controllerName = typeof(T).Name;             if (controllerName.EndsWith("Controller", StringComparison.OrdinalIgnoreCase))             {                 controllerName = controllerName.Remove(controllerName.Length - 10, 10);             }             var values = BuildParameterValuesFromExpression(body) ?? new RouteValueDictionary();             values.Add("controller", controllerName);             values.Add("action", name);             return values;         }         private static RouteValueDictionary BuildParameterValuesFromExpression(MethodCallExpression call)         {             // Build up a RouteValueDictionary containing parameter names as keys and parameter values             // as values based on the MethodCallExpression passed in.             var values = new RouteValueDictionary();             ParameterInfo[] parameters = call.Method.GetParameters();             // If the passed in method has no parameters, just return an empty dictionary.             if (parameters.Length == 0)             {                 return values;             }             for (int i = 0; i < parameters.Length; i++)             {                 object parameterValue;                 Expression expression = call.Arguments[i];                 // If the current parameter is a constant, just use its value as the parameter value.                 var constant = expression as ConstantExpression;                 if (constant != null)                 {                     parameterValue = constant.Value;                 }                 else                 {                     // Otherwise, compile and execute the expression and use that as the parameter value.                     var function = Expression.Lambda<Func<object>>(Expression.Convert(expression, typeof(object)),                                                                    new ParameterExpression[0]);                     try                     {                         parameterValue = function.Compile()();                     }                     catch                     {                         parameterValue = null;                     }                 }                 values.Add(parameters[i].Name, parameterValue);             }             return values;         }     }   Some observations: The first two DataBoundSelectList overloaded methods are specifically built to load the data right into the drop down box as part of the HTML response stream rather than let Knockout's engine populate the options client-side. The third overloaded method does it client-side via the viewmodel. The first two overloads can be done when you have no requirement to add complex JSON objects to your lists. Furthermore, why render and parse the JSON object when you can have it all built and rendered server-side like any other list control.

    Read the article

  • ASP MVC: Submitting a form with nested user controls

    - by Nigel
    I'm fairly new to ASP MVC so go easy :). I have a form that contains a number of user controls (partial views, as in System.Web.Mvc.ViewUserControl), each with their own view models, and some of those user controls have nested user controls within them. I intended to reuse these user controls so I built up the form using a hierarchy in this way and pass the form a parent view model that contains all the user controls' view models within it. For example: Parent Page (with form and ParentViewModel) -->ChildControl1 (uses ViewModel1 which is passed from ParentViewModel.ViewModel1 property) -->ChildControl2 (uses ViewModel2 which is passed from ParentViewModel.ViewModel2 property) -->ChildControl3 (uses ViewModel3 which is passed from ViewModel2.ViewModel3 property) I hope this makes sense... My question is how do I retrieve the view data when the form is submitted? It seems the view data cannot bind to the ParentViewModel: public string Save(ParentViewModel viewData)... as viewData.ViewModel1 and viewData.ViewModel2 are always null. Is there a way I can perform a custom binding? Ultimately I need the form to be able to cope with a dynamic number of user controls and perform an asynchronous submission without postback. I'll cross those bridges when I come to them but I mention it now so any answer won't preclude this functionality. Many thanks.

    Read the article

  • wrapping user controls in a transaction

    - by Hans Gruber
    I'm working on heavily dynamic and configurable CMS system. Therefore, many pages are composed of a dynamically loaded set of user controls. To enable loose coupling between containers (pages) and children (user controls), all user controls are responsible for their own persistence. Each User Control is wired up to its data/service layer dependencies via IoC. They also implement an IPersistable interface, which allows the container .aspx page to issue a Save command to its children without knowledge of the number or exact nature of these user controls. Note: what follows is only pseudo-code: public class MyUserControl : IPersistable, IValidatable { public void Save() { throw new NotImplementedException(); } public bool IsValid() { throw new NotImplementedException(); } } public partial class MyPage { public void btnSave_Click(object sender, EventArgs e) { foreach (IValidatable control in Controls) { if (!control.IsValid) { throw new Exception("error"); } } foreach (IPersistable control in Controls) { if (!control.Save) { throw new Exception("error"); } } } } I'm thinking of using declarative transactions from the System.EnterpriseService namespace to wrap the btnSave_Click in a transaction in case of an exception, but I'm not sure how this might be achieved or any pitfalls to such an approach.

    Read the article

  • wrapping aspx user controls commands in a transaction

    - by Hans Gruber
    I'm working on heavily dynamic and configurable CMS system. Therefore, many pages are composed of a dynamically loaded set of user controls. To enable loose coupling between containers (pages) and children (user controls), all user controls are responsible for their own persistence. Each User Control is wired up to its data/service layer dependencies via IoC. They also implement an IPersistable interface, which allows the container .aspx page to issue a Save command to its children without knowledge of the number or exact nature of these user controls. Note: what follows is only pseudo-code: public class MyUserControl : IPersistable, IValidatable { public void Save() { throw new NotImplementedException(); } public bool IsValid() { throw new NotImplementedException(); } } public partial class MyPage { public void btnSave_Click(object sender, EventArgs e) { foreach (IValidatable control in Controls) { if (!control.IsValid) { throw new Exception("error"); } } foreach (IPersistable control in Controls) { if (!control.Save) { throw new Exception("error"); } } } } I'm thinking of using declarative transactions from the System.EnterpriseService namespace to wrap the btnSave_Click in a transaction in case of an exception, but I'm not sure how this might be achieved or any pitfalls to such an approach.

    Read the article

  • Membership in ASP.Net applications - part 2

    - by nikolaosk
    This is the second post in a series of posts regarding ASP.Net built in membership functionality,providers,controls. You can read the first one post one here . In order to follow this post, complete the steps in the first post. It will only take 10 minutes or so. 1) Launch Visual Studio 2005,2008/2010. Express editions will work fine. I am using Visual Studio 2010 Ultimate edition. 2) Follow all the steps in the first post of the series. 3) Run your application to make sure it runs. 4) Change the...(read more)

    Read the article

  • Missing WYSIWYG controls in Trac

    - by 01es
    I'm not sure whether this was the case right after the Trac installation or as the result of some misconfiguration. Below is a screecapture of a wikipage in the edit mode, where the standard WYSIWYG controls (expected to be present just above the text input in the left corner) are missing. In an attempt to solve the issue, TracWysiwygPlugin was installed, but this has not changed the situation. What could be the reason for missing WYSIWYG controls and how could it be fixed?

    Read the article

  • MS Access 2003 - Option Group frame: can I add text boxes that are part of the frame instead of rad

    - by Justin
    Ok so this maybe a simple/silly question but I don't know so here goes: In access let's say I want to have a frame control, so I click the option group button and add it to the desgin surface. However, I am not wanting to use this as a option group with radio button selection, instead I would like to add text boxes instead the frame, so that when I reference the frame, it references every control instead of it, hence the text boxes, cbo boxes, etc.....just as it would if they were radio option selections. So can you do this? I want whatever controls I add inside the frame to be easily referenced (i.e. make all controls visible just by using frameExample.visible = true) so that I can build my own tab control groupings..... can this be done? Thanks! EDIT: What I am trying to accomplish is having a form that includes a collection of controls (input controls - cbo boxes, text boxes, etc), that serve as the Main record information. These are saved to a table via an INSERT statement on button_click because this form is unbound. Next I have 8 categories that are relative per each main record (and data that goes along with it). Each of these categories could have a sub form area and a button click that bring it's relative form into the sub form area. These sub forms would be unbound as well as I would just save data via SQL statement. So i know I could accomplish this by running the insert statement from the parent form, on the main collection control's data that would create the KeyID number, then run a SQL statement that would turn around and load that KeyID number right back onto the page in a hidden text box. Then when I click one of the sub forms and load its relative collection of controls, I could then save that data along with KeyID for each of these sub-forms/tables. SO...... I was wondering if instead you could define these controls as a collection so that you could hide and make visible all the ones you need on button clicks and avoid the need for additional forms (subs). I know that if a user enters data into a text box, and then somewhere along the way that box becomes hidden, the data still exists in it and still ends up in the SQL statement.... So I want all these controls to exist on the same form, but I thought what is I could encapsulate them into a frame like an option group, then I could call the frame and all the relative controls would be called up (made visible) as needed. Sorry for the long explanation but I thought it would help.

    Read the article

  • Disabling all the Page Control through jQuery.

    - by Sanju
    I am working on asp.net and c#. I am using lots of ASP and HTML controls on the page and in some cases all the controls gets disabled. Some of the used Controls are: RadioButton RadioButtonList CheckBox CheckBoxList TextBox DropDownList Button etc... I need a Simple and short method to disabled all the Controls when i call this jQuery method on some condition. Any Help? Thanks in Advance...

    Read the article

  • An open source WPF report engine that gets benefits from the current WPF controls,

    WPF changes the things greatly by providing the capability of printing Visual objects. It persuades many people to setup an open source report engine as in this article.  read moreBy Siyamand AyubiDid you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >