Search Results

Search found 7498 results on 300 pages for 'dependent controls'.

Page 18/300 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Context dependent validation

    - by Ole Lynge
    I would like to be able to validate an object in different contexts using DataAnnotations in .NET 4. For example: If I have a class with these annotated properties [Required] public string Name { get; set; } [Required] public string PhoneNumber { get; set; } [Required] public string Address { get; set; } I would like to be able to do something like bool namePhoneValid = Validator.TryValidateObject(entity, contextNamePhone, results1); bool allValid = Validator.TryValidateObject(entity, contextAll, results2); where contextNamePhone only validates Name and Phone, and contextAll validates all properties (Name, Phone and Address in this case). Is this possible? How should the validation context be constructed? Are there other/smarter ways to do this?

    Read the article

  • Focus-dependent text change for TextBoxes in WPF

    - by Simon
    Hey there. I'm writing an application in WPF using the MVVM-pattern and will really often use TextBoxes. I don't want to use labels for the user to know user what the text box is for, i.e. I don't want something like this: <TextBlock> Name: </TextBlock> <TextBox /> Instead, I would like the TextBox to contain its own label. Statically, you would express it like this: <TextBox>Name</TextBox> If the cursor is displayed in the textbox, i.e. the TextBox gains focus, I want the description text to disappear. If the TextBox is left empty and it loses the focus, the description text should be shown again. It's similar to the search textbox of StackOverflow or the one of Firefox. (please tell me if your not sure what I mean). One TextBox's label may change at runtime, dependending on e.g. a ComboBox's selected element or a value in my ViewModel. (It's like in Firefox's search TextBox, if you select google from the search engins' menu, the TextBox's label changes to "Google", if you select "Yahoo" its set to "Yahoo"). Thus I want to be able to bind the label's content. Consider that I may already have a Binding on the Text-Property of the TextBox. How can implement such a behaviour and make it reusable for any of my TextBox's? Code is welcome but not needed; a description of what to do is enough. Thank you in advance.

    Read the article

  • Passing dependent objects to a parent constructor in Scala

    - by Nick Johnson
    Suppose I have the following class heirarchy: class A() class B(a:A) class C(b:B) class BaseClass(b:B, c:C) Now I want to implement a subclass of BaseClass, which is given an instance of A, and constructs instances of B and C, which it passes to its superclass constructor. If I could use arbitrary expressions, I'd do something like this: b = new B(a) c = new C(b) super(b, c) Because the second argument to the parent constructor depends on the value of the first argument, though, I can't see any way to do this, without using a factory function, or a gratuitous hack, such as : class IntermediateSubclass(b:B) extends BaseClass(b, new C(b)) class RealSubclass(a:A) extends IntermediateSubclass(new B(a)) Is there clean way to do this?

    Read the article

  • Nested loop with dependent bounds trip count

    - by aaa
    hello. just out of curiosity I tried to do the following, which turned out to be not so obvious to me; Suppose I have nested loops with runtime bounds, for example: t = 0 // trip count for l in 0:N for k in 0:N for j in max(l,k):N for i in k:j+1 t += 1 t is loop trip count is there a general algorithm/way (better than N^4 obviously) to calculate loop trip count? I am working on the assumption that the iteration bounds depend only on constant or previous loop variables.

    Read the article

  • Make DLL dependent to other DLLs (Visual Studio IDE)

    - by Artefacto
    I'm having an inconsistency when compiling a DLL (let's call it x.dll) by calling cl.exe obj1.obj obj2.obj ... lib1.lib lib2.lib ... /link /out:x.dll /dll /debug and When using the IDE (which calls link directly, I believe). Let's say lib1.lib is an import library for lib1.dll. Opening the DLL generated by calling cl.exe in the depency walker shows it depends on lib1.dll. However, when using the IDE, the generated program is smaller and does not depend on lib1.dll. This IDE-generated image makes the program that uses x.dll crash sometimes. The question is: how do I get the correct behaviour from the IDE?

    Read the article

  • 2 (or more) ComboBoxes dependent on each other

    - by Mcad001
    Hi, I have an Organisation entity and a Region entity. An object of type Organisation can have one or more Region objects connected to it, thus I have a foreign key in my Region entity to the Organisation Entity. The Organisation and Region objects are pulled from my database using WCF RIA and entity framework. I want to put the Organisation objects in one ComboBox and the Region objects in another ComboBox, and when selecting an organsation having the ComboBox for Region objects automatically only showing regions that are connected to the selected organisation. Should be pretty basic, but the way I've designed it right now it doesnt work at all. So, any hint to how I can achive this? A simple simple codeexample is much appreciated! (I'm using SL4,WCF RIA MVVM)

    Read the article

  • Would like some modelling tips for dependent values

    - by orjan
    I'm working on a model for a simple fishing competition and I have some issues with my design. The main class for the fishing game is Capture and it looks like this: public class Capture : Entity { public virtual int Weight { get; set; } public virtual int Length { get; set; } public virtual DateTime DateForCapture { get; set; } public virtual User CapturedBy { get; set; } public virtual Species Species { get; set; } } So far there´s no problem but I'm not really sure how to model the game. Every Species is connected to a reference weight that changes from year to year The number of point for a capture is its Weight divided by the current reference weight for the species. One way to solve the problem is to connect a capture to SpeciesReferenceWeight instead of Species public class SpeciesReferenceWeight : Entity { public virtual Species Species { get; set; } public virtual int ReferenceWeight { get; set; } public virtual int Year { get; set; } } But in that way that Capture is connected to the implementation details of the game and from my point of view a capture is still a capture even if it's not included in a game. The result I'm aiming for is like: http://hornalen.net/fishbonkern/2007/ that I wrote a couple of years ago with brute force sql and no domain model. I would be very happy for all kinds of feeback on this issue.

    Read the article

  • python mock side_effect or return_value dependent on call_count

    - by user18380
    To test a polling function I want to mock the calling of a sub function so that the first time it is called it will fail, and the second time it is called it will succeed. Here's a very simplified version of it: poll_function(var1): value = sub_function(var1) # First call will return None while not value: time.sleep(POLLING_INTERVAL) value = sub_function(var1) # A subsequent call will return a string, e.g "data" return value Is this possible to do with a Mock object from the mock framework? I know Mock objects have a call_count attribute I should be able to use somehow. Right now I've solved it by creating a custom mock object that I use to monkey patch sub_function(), but I feel there should be a better less verbose way of doing it: def test_poll(): class MyMock(object): def __init__(self, *args): self.call_count = 0 def sub_function(self, *args, **kwargs): if self.call_count > 1: return "data" else: self.call_count += 1 return None my_mock = MyMock() with patch('sub_function', my_mock.sub_function): ok_(poll_function())

    Read the article

  • multiple dependent android projects in eclipse

    - by lope
    Hi there! I just started to play with android dev and java+eclipse is pretty new to me. I managed to create simple project and run it on my device. Now I want to create simple game (more of them actually) and I would love to use shared code base for all of them (game loop, initialization, etc..). Problem is that I have no idea how to correctly do this. I created android project called engine with all basic stuff that I need and made it work on device. Now I tried to create another project in same workspace called mygame. Main class (activity) of mygame is MyGameApp which inherits from EngineApp (main activity of my engine project) which inherits from Activity. I added engine project into required projects in mygame build path tab in properties. Problem is that when I try to run this project it crashes on ClassNotFoundException trying to find my MyGameApp class. Any help (or pointer to some articles that explain how this is done) is greatly appreciated. few hours of googling didn't help much :/

    Read the article

  • Cleaner HTML Markup with ASP.NET 4 Web Forms - Client IDs (VS 2010 and .NET 4.0 Series)

    - by ScottGu
    This is the sixteenth in a series of blog posts I’m doing on the upcoming VS 2010 and .NET 4 release. Today’s post is the first of a few blog posts I’ll be doing that talk about some of the important changes we’ve made to make Web Forms in ASP.NET 4 generate clean, standards-compliant, CSS-friendly markup.  Today I’ll cover the work we are doing to provide better control over the “ID” attributes rendered by server controls to the client. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] Clean, Standards-Based, CSS-Friendly Markup One of the common complaints developers have often had with ASP.NET Web Forms is that when using server controls they don’t have the ability to easily generate clean, CSS-friendly output and markup.  Some of the specific complaints with previous ASP.NET releases include: Auto-generated ID attributes within HTML make it hard to write JavaScript and style with CSS Use of tables instead of semantic markup for certain controls (in particular the asp:menu control) make styling ugly Some controls render inline style properties even if no style property on the control has been set ViewState can often be bigger than ideal ASP.NET 4 provides better support for building standards-compliant pages out of the box.  The built-in <asp:> server controls with ASP.NET 4 now generate cleaner markup and support CSS styling – and help address all of the above issues.  Markup Compatibility When Upgrading Existing ASP.NET Web Forms Applications A common question people often ask when hearing about the cleaner markup coming with ASP.NET 4 is “Great - but what about my existing applications?  Will these changes/improvements break things when I upgrade?” To help ensure that we don’t break assumptions around markup and styling with existing ASP.NET Web Forms applications, we’ve enabled a configuration flag – controlRenderingCompatbilityVersion – within web.config that let’s you decide if you want to use the new cleaner markup approach that is the default with new ASP.NET 4 applications, or for compatibility reasons render the same markup that previous versions of ASP.NET used:   When the controlRenderingCompatbilityVersion flag is set to “3.5” your application and server controls will by default render output using the same markup generation used with VS 2008 and .NET 3.5.  When the controlRenderingCompatbilityVersion flag is set to “4.0” your application and server controls will strictly adhere to the XHTML 1.1 specification, have cleaner client IDs, render with semantic correctness in mind, and have extraneous inline styles removed. This flag defaults to 4.0 for all new ASP.NET Web Forms applications built using ASP.NET 4. Any previous application that is upgraded using VS 2010 will have the controlRenderingCompatbilityVersion flag automatically set to 3.5 by the upgrade wizard to ensure backwards compatibility.  You can then optionally change it (either at the application level, or scope it within the web.config file to be on a per page or directory level) if you move your pages to use CSS and take advantage of the new markup rendering. Today’s Cleaner Markup Topic: Client IDs The ability to have clean, predictable, ID attributes on rendered HTML elements is something developers have long asked for with Web Forms (ID values like “ctl00_ContentPlaceholder1_ListView1_ctrl0_Label1” are not very popular).  Having control over the ID values rendered helps make it much easier to write client-side JavaScript against the output, makes it easier to style elements using CSS, and on large pages can help reduce the overall size of the markup generated. New ClientIDMode Property on Controls ASP.NET 4 supports a new ClientIDMode property on the Control base class.  The ClientIDMode property indicates how controls should generate client ID values when they render.  The ClientIDMode property supports four possible values: AutoID—Renders the output as in .NET 3.5 (auto-generated IDs which will still render prefixes like ctrl00 for compatibility) Predictable (Default)— Trims any “ctl00” ID string and if a list/container control concatenates child ids (example: id=”ParentControl_ChildControl”) Static—Hands over full ID naming control to the developer – whatever they set as the ID of the control is what is rendered (example: id=”JustMyId”) Inherit—Tells the control to defer to the naming behavior mode of the parent container control The ClientIDMode property can be set directly on individual controls (or within container controls – in which case the controls within them will by default inherit the setting): Or it can be specified at a page or usercontrol level (using the <%@ Page %> or <%@ Control %> directives) – in which case controls within the pages/usercontrols inherit the setting (and can optionally override it): Or it can be set within the web.config file of an application – in which case pages within the application inherit the setting (and can optionally override it): This gives you the flexibility to customize/override the naming behavior however you want. Example: Using the ClientIDMode property to control the IDs of Non-List Controls Let’s take a look at how we can use the new ClientIDMode property to control the rendering of “ID” elements within a page.  To help illustrate this we can create a simple page called “SingleControlExample.aspx” that is based on a master-page called “Site.Master”, and which has a single <asp:label> control with an ID of “Message” that is contained with an <asp:content> container control called “MainContent”: Within our code-behind we’ll then add some simple code like below to dynamically populate the Label’s Text property at runtime:   If we were running this application using ASP.NET 3.5 (or had our ASP.NET 4 application configured to run using 3.5 rendering or ClientIDMode=AutoID), then the generated markup sent down to the client would look like below: This ID is unique (which is good) – but rather ugly because of the “ct100” prefix (which is bad). Markup Rendering when using ASP.NET 4 and the ClientIDMode is set to “Predictable” With ASP.NET 4, server controls by default now render their ID’s using ClientIDMode=”Predictable”.  This helps ensure that ID values are still unique and don’t conflict on a page, but at the same time it makes the IDs less verbose and more predictable.  This means that the generated markup of our <asp:label> control above will by default now look like below with ASP.NET 4: Notice that the “ct100” prefix is gone. Because the “Message” control is embedded within a “MainContent” container control, by default it’s ID will be prefixed “MainContent_Message” to avoid potential collisions with other controls elsewhere within the page. Markup Rendering when using ASP.NET 4 and the ClientIDMode is set to “Static” Sometimes you don’t want your ID values to be nested hierarchically, though, and instead just want the ID rendered to be whatever value you set it as.  To enable this you can now use ClientIDMode=static, in which case the ID rendered will be exactly the same as what you set it on the server-side on your control.  This will cause the below markup to be rendered with ASP.NET 4: This option now gives you the ability to completely control the client ID values sent down by controls. Example: Using the ClientIDMode property to control the IDs of Data-Bound List Controls Data-bound list/grid controls have historically been the hardest to use/style when it comes to working with Web Form’s automatically generated IDs.  Let’s now take a look at a scenario where we’ll customize the ID’s rendered using a ListView control with ASP.NET 4. The code snippet below is an example of a ListView control that displays the contents of a data-bound collection — in this case, airports: We can then write code like below within our code-behind to dynamically databind a list of airports to the ListView above: At runtime this will then by default generate a <ul> list of airports like below.  Note that because the <ul> and <li> elements in the ListView’s template are not server controls, no IDs are rendered in our markup: Adding Client ID’s to Each Row Item Now, let’s say that we wanted to add client-ID’s to the output so that we can programmatically access each <li> via JavaScript.  We want these ID’s to be unique, predictable, and identifiable. A first approach would be to mark each <li> element within the template as being a server control (by giving it a runat=server attribute) and by giving each one an id of “airport”: By default ASP.NET 4 will now render clean IDs like below (no ctl001-like ids are rendered):   Using the ClientIDRowSuffix Property Our template above now generates unique ID’s for each <li> element – but if we are going to access them programmatically on the client using JavaScript we might want to instead have the ID’s contain the airport code within them to make them easier to reference.  The good news is that we can easily do this by taking advantage of the new ClientIDRowSuffix property on databound controls in ASP.NET 4 to better control the ID’s of our individual row elements. To do this, we’ll set the ClientIDRowSuffix property to “Code” on our ListView control.  This tells the ListView to use the databound “Code” property from our Airport class when generating the ID: And now instead of having row suffixes like “1”, “2”, and “3”, we’ll instead have the Airport.Code value embedded within the IDs (e.g: _CLE, _CAK, _PDX, etc): You can use this ClientIDRowSuffix approach with other databound controls like the GridView as well. It is useful anytime you want to program row elements on the client – and use clean/identified IDs to easily reference them from JavaScript code. Summary ASP.NET 4 enables you to generate much cleaner HTML markup from server controls and from within your Web Forms applications.  In today’s post I covered how you can now easily control the client ID values that are rendered by server controls.  In upcoming posts I’ll cover some of the other markup improvements that are also coming with the ASP.NET 4 release. Hope this helps, Scott

    Read the article

  • Flex 3 Value aware combo box error

    - by user1057094
    I am using a value aware combobox, it was working fine, but recently i started getting the below error, when I try to click on combobox, and the error is random. I am not sure of it is because of any changes i have done in the coding, or some changes in data provider etc any help is appreciated... TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::ComboBox/destroyDropdown() at mx.controls::ComboBox/styleChanged() at mx.core::UIComponent/setBorderColorForErrorString() at mx.core::UIComponent/commitProperties() at mx.controls::ComboBase/commitProperties() at mx.controls::ComboBox/commitProperties() at custom.controls::ComboBox/commitProperties()[D:\workspace\eclipse\indigo\ams\flex_src\custom\controls\ComboBox.mxml:13] at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/doPhasedInstantiation() Debugger throws TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::ComboBox/destroyDropdown() at mx.controls::ComboBox/styleChanged() at mx.core::UIComponent/setBorderColorForErrorString() at mx.core::UIComponent/commitProperties() at mx.controls::ComboBase/commitProperties() at mx.controls::ComboBox/commitProperties() at custom.controls::ComboBox/commitProperties()[D:\workspace\eclipse\indigo\ams\flex_src\custom\controls\ComboBox.mxml:13] at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/doPhasedInstantiation() at mx.managers::LayoutManager/validateNow() at mx.controls::ComboBox/displayDropdown() at mx.controls::ComboBox/downArrowButton_buttonDownHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::buttonPressed() at mx.controls::Button/mouseDownHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.controls::ComboBase/textInput_mouseEventHandler()

    Read the article

  • Custom ASP.Net MVC 2 ModelMetadataProvider for using custom view model attributes

    - by SeanMcAlinden
    There are a number of ways of implementing a pattern for using custom view model attributes, the following is similar to something I’m using at work which works pretty well. The classes I’m going to create are really simple: 1. Abstract base attribute 2. Custom ModelMetadata provider which will derive from the DataAnnotationsModelMetadataProvider   Base Attribute MetadataAttribute using System; using System.Web.Mvc; namespace Mvc2Templates.Attributes {     /// <summary>     /// Base class for custom MetadataAttributes.     /// </summary>     public abstract class MetadataAttribute : Attribute     {         /// <summary>         /// Method for processing custom attribute data.         /// </summary>         /// <param name="modelMetaData">A ModelMetaData instance.</param>         public abstract void Process(ModelMetadata modelMetaData);     } } As you can see, the class simple has one method – Process. Process accepts the ModelMetaData which will allow any derived custom attributes to set properties on the model meta data and add items to its AdditionalValues collection.   Custom Model Metadata Provider For a quick explanation of the Model Metadata and how it fits in to the MVC 2 framework, it is basically a set of properties that are usually set via attributes placed above properties on a view model, for example the ReadOnly and HiddenInput attributes. When EditorForModel, DisplayForModel or any of the other EditorFor/DisplayFor methods are called, the ModelMetadata information is used to determine how to display the properties. All of the information available within the model metadata is also available through ViewData.ModelMetadata. The following class derives from the DataAnnotationsModelMetadataProvider built into the mvc 2 framework. I’ve overridden the CreateMetadata method in order to process any custom attributes that may have been placed above a property in a view model.   CustomModelMetadataProvider using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using Mvc2Templates.Attributes; namespace Mvc2Templates.Providers {     public class CustomModelMetadataProvider : DataAnnotationsModelMetadataProvider     {         protected override ModelMetadata CreateMetadata(             IEnumerable<Attribute> attributes,             Type containerType,             Func<object> modelAccessor,             Type modelType,             string propertyName)         {             var modelMetadata = base.CreateMetadata(attributes, containerType, modelAccessor, modelType, propertyName);               attributes.OfType<MetadataAttribute>().ToList().ForEach(x => x.Process(modelMetadata));               return modelMetadata;         }     } } As you can see, once the model metadata is created through the base method, a check for any attributes deriving from our new abstract base attribute MetadataAttribute is made, the Process method is then called on any existing custom attributes with the model meta data for the property passed in.   Hooking it up The last thing you need to do to hook it up is set the new CustomModelMetadataProvider as the current ModelMetadataProvider, this is done within the Global.asax Application_Start method. Global.asax protected void Application_Start()         {             AreaRegistration.RegisterAllAreas();               RegisterRoutes(RouteTable.Routes);               ModelMetadataProviders.Current = new CustomModelMetadataProvider();         }   In my next post, I’m going to demonstrate a cool custom attribute that turns a textbox into an ajax driven AutoComplete text box. Hope this is useful. Kind Regards, Sean McAlinden.

    Read the article

  • New Release: ImageGlue 7.0 .NET

    When it comes to manipulating images dynamically there are few toolkits that can compete with ImageGlue 6 in terms of versatility and performance. With extensive support for a huge range of graphic formats including JPEG2000, Very Large TIFF Support™, and fully multi-threaded processing, ImageGlue has proved a popular choice for use in ASP and ASP.NET server environments. Now ImageGlue 7 has arrived, introducing support for 64-bit systems, improved PostScript handling, and many other enhancements. We've also used the opportunity to revise the API, to make it more friendly and familiar to .NET coders. But don't worry about rewriting legacy code - you'll find the 'string parameter' interface is still available through the WebSupergoo.ImageGlue6 namespace. So what's new in ImageGlue 7.0? Support for 64-bit systems. ImageGlue now incorporates the PostScript rendering engine as used by ABCpdf, our PDF component, which has proven to be fast, robust and accurate. This greatly improves support for importing and exporting PS, EPS, and PDF files, and also enables you to make use of powerful PostScript drawing operations for drawing to canvas. Leveraging ABCpdf's powerful vector graphics import and export functionality also makes it possible to interoperate with XPS and MS Office documents. An improved API with new classes, methods and properties, more in keeping with normal .NET development. Plus of course the usual range of bug fixes and minor enhancements. span.fullpost {display:none;}

    Read the article

  • Customizing CreateUserWizard control to show only Sign Up step

    - by bipinjoshi
    Recently a reader asked - Can CreateUserWizard control be customized to show a predefined Security Questions instead of allowing user to enter his own question? Can CreateUserWizard control be configured such that it shows only one step (Sign Up)? Can the completion step be skipped altogether? This short post is an attempt to answer these questions.http://www.bipinjoshi.net/articles/6439dc7c-08c7-4eec-b196-d1590699224c.aspx 

    Read the article

  • VWG extended ListView control

    - by Visual WebGui
    We would like to share with you the cool capabilities that the VWG extended ListView control allows over Asp.Net. An example for a cool implementation of the extended ListView control (created by a Visual WebGui community member) can be seen here: http://www.screencast.com/t/N2U5ZDRiNz You can also download the code and play with it Download Code If you would like to learn more about the extended ListView control you can watch the a webcast dedicated to that topic http://vimeo.com/11707236...(read more)

    Read the article

  • The Image ASP.Net web server control

    - by nikolaosk
    In this post I will try to show you how to use the ImageMap web server control. This is going to be a very easy example. We will write no code but I will use the control to create navigation hotspots. 1) Launch Visual Studio 2010/2005/2008. Express editions will be fine. 2) Create a new asp.net empty web site and call it “ NavigationHotspot ”. 3) Drag and drop in the default.aspx page a ImageMap web server control from the Toolbox. 4) Let me explain what I did. I have an image that contains two flags...(read more)

    Read the article

  • A WPF Image/Text Button

    - by psheriff
    Some of our customers are asking us to give them a Windows 8 look and feel for their applications. This includes things like buttons, tiles, application bars, and other features. In this blog post I will describe how to create a button that looks similar to those you will find in a Windows 8 application bar. In Figure 1 you can see two different kinds of buttons. In the top row is a WPF button where the content of the button includes a Border, an Image and a TextBlock. In the bottom row are four...(read more)

    Read the article

  • How do I restrict my kids' computing time?

    - by Takkat
    Access to our computer (not only to the internet) needs to be restricted for the accounts of my kids (7, 8) until they are old enough to manage this by themselves. Until then we need to be able to define the following: the hours of the day when computing is o.k. (e.g. 5 - 9 pm) the days of the week when computing is not o.k. (e.g. mondays to fridays) the amount of time allowed per day (e.g. 2 hours) In 11.10 all of the following that used to do the job don't work any more: Timekpr: for 11.10 not available through the ppa. The installed version from 11.04 does not work in 11.10. Timoutd: command line alternative, but in 11.10 removed from the repositories. Gnome Nanny: Looks great but repeatedly crashes to force restarting X-server. So we can't use or recommed this program at the moment. Are there any other alternatives?

    Read the article

  • What is the best way to restrict access to adult content on Ubuntu?

    - by Stephen Myall
    I bought my kids a PC and installed 12.04 (Unity) on it. The bottom line is, I want my children to use the computer unsupervised while I have confidence they cannot access anything inappropriate. What I have looked at: I was looking at Scrubit a tool which allows me configure my wifi router to block content and this solution would also protect my other PC and mobile devices. This may be overkill as I just want the solution to work on one PC. I also did some Google searches and came across the application called Nanny (it seems to look the part). My experience of OSS is that the best solutions frequently never appear first on a Google search list and in this case I need to trust the methods therefore my question is very specific. I want to leverage your knowledge and experience to understand “What is the best way to restrict adult content on 12.04 LTS” as this is important to me. It maybe a combination of things so please don't answer this question "try this or that", then give me some PPA unless you can share your experience of how good it is and of course if there are any contraints. Thanks in advance

    Read the article

  • What is the best way to restrict adult content on 12.04 LTS

    - by Stephen Myall
    I bought my kids a PC and installed 12.04 (Unity) on it. The bottom line is, I want my children to use the computer unsupervised while I have confidence they cannot access anything inappropriate. What I have looked at: I was looking at Scrubit which allows me configure my wifi router but this solution would also affect my other PC and mobile devices. This is not feasible as I just want the solution to work on one PC. I also did some Google searches and came across Nanny (it seems to look the part). My experience of OSS is that the best solutions frequently never appear first on a Google search list so my question is very specific. I want to leverage your knowledge and experience to understand “What is the best way to restrict adult content on 12.04 LTS” as this is important to me. Please don't answer this question "try this or that", then give me some PPA, I am looking for knowledge and experience from someone in my situation. Thanks in advance

    Read the article

  • ASP.NET putting dynamic controls on page in reverse messes up events

    - by Jimmy Geels
    I have this weird problem when putting textboxes on the page in reverse. The whole event system is messed up. Changing one textbox fires TextChange on all textboxes. I can fix this by putting the controls in a list first and then call add while iterating trough the list in reverse. But i just want to know why this fails. Heres some code (.net 2.0) public partial class _Default : Page { protected void Page_Load(object sender, EventArgs e) { InitFields(); } private void InitFields() { int nrFields; //We have a static textbox called nrElements, this determines the number //of fields to initialize if (int.TryParse(nrElements.Text, out nrFields)) { //Put all the dynamic fields on the screen in reverse order foreach(Control t in GetDynamicFields(nrFields)) { //Calling Controls.Add works fine //Calling Controls.AddAt messes up the events //Try changing different textboxes plhFields.Controls.AddAt(0, t); } } } private IEnumerable<Control> GetDynamicFields(int nrFields) { for (int i = 0; i < nrFields; i++) { TextBox txtBox = new TextBox(); txtBox.ID = string.Format("dynTextBox{0}", i.ToString()); txtBox.AutoPostBack = true; txtBox.TextChanged += t_TextChanged; yield return txtBox; } } private void t_TextChanged(object sender, EventArgs e) { TextBox txtBox = sender as TextBox; if (txtBox != null) txtBox.Text = txtBox.Text + "Changed "; } }

    Read the article

  • ASP.NET Event delegation between user controls

    - by Ishan
    Give the following control hierarchy on a ASP.NET page: Page HeaderControl       (User Control) TitleControl       (Server Control) TabsControl       (User Control) other controls I'm trying to raise an event (or some notification) in the TitleControl that bubbles to the Page level. Then, I'd like to (optionally) register an event handler at the Page codebehind that will take the EventArgs and modify the TabsControl in the example above. The important thing to note is that this design will allow me to drop these controls into any Page and make the entire system work seamlessly if the event handler is wired up. The solution should not involve a call to FindControl() since that becomes a strong association. If no handler is defined in the containing Page, the event is still raised by TitleControl but is not handled. My basic goal is to use event-based programming so that I can decouple the user controls from each other. The event from TitleControl is only raised in some instances, and this seemed to be (in my head) the preferred approach. However, I can't seem to find a way to cleanly achieve this. Here are my (poor) attempts: Using HttpContext.Current.Items Add the EventArgs to the Items collection on TitleControl and pick it up on the TabsControl. This works but it's fundamentally hard to decipher since the connection between the two controls is not obvious. Using Reflection Instead of passing events, look for a function on the container Page directly within TitleControl as in: Page.GetType().GetMethod("TabControlHandler").Invoke(Page, EventArgs); This will work, but the method name will have to be a constant that all Page instances will have to defined verbatim. I'm sure that I'm over-thinking this and there must be a prettier solution using delegation, but I can't seem to think of it. Any thoughts?

    Read the article

  • Getting data from child controls loaded programmatically

    - by Farinha
    I've created 2 controls to manipulate a data object: 1 for viewing and another for editing. On one page I load the "view" User Control and pass data to it this way: ViewControl control = (ViewControl)LoadControl("ViewControl.ascx"); control.dataToView = dataObject; this.container.Controls.Add(control); That's all fine and inside the control I can grab that data and display it. Now I'm trying to follow a similar approach for editing. I have a different User Control for this (with some textboxes for editing) to which I pass the original data the same way I did for the view: EditControl control = (EditControl)LoadControl("EditControl.ascx"); control.dataToEdit = dataObject; this.container.Controls.Add(control); Which also works fine. The problem now is getting to this data. When the user clicks a button I need to fetch the data that was edited and do stuff with it. What's happening is that because the controls are being added programmatically, the data that the user changed doesn't seem to be accessible anywhere. Is there a solution for this? Or is this way of trying to keep things separated and possibly re-usable not possible? Thanks in advance.

    Read the article

  • Stop Visual Studio from appending numbers to the end of new controls

    - by techturtle
    I am wondering if there is any way to stop Visual Studio 2010 from appending a number to the end of the ID on new controls I create. For example, when I add a new TextBox, I would prefer that it do this: <asp:TextBox ID="TextBox" runat="server"> <asp:TextBox ID="TextBox" runat="server"> <asp:TextBox ID="TextBox" runat="server"> Instead of this: <asp:TextBox ID="TextBox1" runat="server"> <asp:TextBox ID="TextBox2" runat="server"> <asp:TextBox ID="TextBox3" runat="server"> It would make it easier to rename them appropriately, so I don't have to arrow/mouse over and delete the number each time. As I was writing this, the "Questions that may already have your answer" suggested this: How do I prevent Visual Studio from renaming my controls? which admittedly was the biggest part of my annoyance, but that appears to turn off putting in an ID="" field altogether, not just for pasted controls. It would still be helpful to turn off the numbering for new, non-pasted controls and have it not rename pasted ones as well. At the moment I'm working with ASP.NET, but it would be nice if it there was a way to do it for WinForms as well. Before anyone suggests it, I do know that allowing it to append the numbers prevents name conflicts should I not rename them appropriately. However, I would much rather have it fail to compile so I know to fix the issue now (if I forget to name something properly) rather than find random "TextBox1" items lying around in the code later on.

    Read the article

  • What causes markup-controls to be null?

    - by Earlz
    Ok, I have a very strange problem. I have a regular UserControl with some controls in the markup. At Page_Load these controls are still null. And I have tried EnsureChildControls It is laid out like this: Masterpage - Page - mycontrol1 - mycontrol2 - problemcontrol ProblemControl is where the controls are null. MyControl1 contains MyControl2. MyControl2 is another UserControl which contains ProblemControl in it's markup. Masterpage is nothing special and Page contains MyControl1 in it's markup. The only oddity is that ProblemControl is created dynamically at Page_Init. Everything works fine until I get to ProblemControl where none of the controls are being created. ProblemControl has the proper things all set such as the Page and Parent property. I do not see any problems. The source code for all of these(except ProblemControl) is pretty extensive, so I'm hoping someone can just give me some troubleshooting tips for this problem and if anyone has encountered it before. Also, I can place ProblemControl on another Page control and it will work fine, it's something about mycontrol1 and/or mycontrol2. But we've never had any problems with mycontrol1 and mycontrol2 doesn't have anything I can see wrong with it. (which I've been tediously analyzing for the past few hours). Has anyone else had this same problem? Are there any common things to check for?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >