Posts

Showing posts from 2010

Maximize child MDI form without ControlBox

Problem: When we try maxing the form as maximum mode using control box buttons , then every thing goes fine and it be maximized and can see the toolbar below. But when we try doing the same with with controlbox = false( this will hide the control box), now if you try making the for to maximize, it will be maximized but it will also hide the toolbar below. When we hide the control box the form will be maximize to the whole screen ( hiding the system toolbar). Solution: Hide the control box on page Code : Please paste this code in form load method In VB Me.ControlBox = False In C# this.ControlBox = false;

Adding text to label using javascript

While accessing label value from JavaScript, we try like this document.getElementById('<%= this.lblClientType.ClientID %>').value But this wont work as it doesn't contain a property called value. Resolution : document.getElementById('<%= this.lblClientType.ClientID %>').innerHTML Reason: Because when we see the page source, label is been converted to span, where as textbox is converted to input control asp:label to span control asp:textbox to input of type "text" Please provide the comments, if any...

Changing the textbox color dynamically

Changing the text box styling dynamically using java script. < script > function txtBr(Recid) { if(Recid==0)document.getElementById ("Text1").style.border ='0px'; if(Recid==1)document.getElementById ("Text1").style.border ='1px'; if(Recid==1)document.getElementById ("Text1").style.borderStyle='solid'; if(Recid==1)document.getElementById ("Text1").style.borderColor ='red'; if(Recid==1)document.getElementById ("Text1").style.backgroundColor='yellow'; if(Recid==1)document.getElementById ("Text1").focus(); } < /script > < /head > < body onload ="txtBr(0);" > < form id="form1" runat="server" > < input id="Text1" type="text" runat ="Server" onmousemove ="txtBr(1);" / >

Dynamically creation of web controls and binding Validations Using ASP.NET

Image
Dynamically creation of web controls and binding Validations Using ASP.NET Source Code : creatingdynamiccontrols2.zip Introduction:- As we know we can bind the controls to our page (aspx) in 2 ways 1. Statically :- Binding the controls while Designing 2. Dynamically :- Binding the controls at runtime Everyone know how to bind statically but there may be some cases where we need to bind the control dynamically .One of those cases is when our controls are keep on changing like I have a registration site in which the control type may keep on changing then I may need to go for binding the controls dynamically . Approach: For binding the controls I need the data what are the controls I want to bind and what is the id to be given and what are the properties to be provided etc., This can be provided by 2 ways 1. Using database (This is my approach) 2. Using Xml file I am creating one example (registration Page) where I am getting the data from the database as a table and ba

Association, Aggregation, Composition

Association, Aggregation, Composition When we have only one relationship between objects that may be Association . Aggregation and Composition.             In details             Association :             This is relation where each object has it own life cycle , independent  and no owner. Ex:-             Will take a common example of project and developer             A project will be having multiple developers and developer can work for different projects. There is a relationship but both are independent. Both can create and delete independently.   Aggregation: This is a specialize form of Association where all object have their own lifecycle has ownership on child object and the child object cannot belongs be related to another parent object. Ex:-             Will take an example of Departments and developers             A developer can be only in one department like dotnet, java etc., but if we delete the Department object still the Developer object exists. This is a “Has-

Difference between XmlNode and XmlElement

XmlElement is derived from XmlNode (XMLElement is a type of XMLNode) and it is having more functionalists than xmlNode XmlElement can be used if you are more specific with XML. Please find all the Node types Node Types The following table lists the different W3C node types, and which node types they may have as children: Node type Description Children Document Represents the entire document (the root-node of the DOM tree) Element (max. one), ProcessingInstruction, Comment, DocumentType DocumentFragment Represents a "lightweight" Document object, which can hold a portion of a document Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference DocumentType Provides an interface to the entities defined for the document None ProcessingInstruction Represents a processing instruction None EntityReference Represents an entity reference Element, ProcessingInstruction, Comment, Text, CDATASection, EntityRe

Association, Aggregation, Composition

Association, Aggregation, Composition When we have only one relationship between objects that may be Association . Aggregation and Composition.             In details             Association :             This is relation where each object has it own life cycle , independent  and no owner. Ex:-             Will take a common example of project and developer             A project will be having multiple developers and developer can work for different projects. There is a relationship but both are independent. Both can create and delete independently.   Aggregation: This is a specialize form of Association where all object have their own lifecycle has ownership on child object and the child object cannot belongs be related to another parent object. Ex:-             Will take an example of Departments and developers             A developer can be only in one department like dotnet, java etc., but if we delete the Department object still the Developer object exists. Th

ASCII Key values

Char. Dec. hex Comments NUL 00 00 SOH 01 01 ^A (control A) STX 02 02 ^B ETX 03 03 ^C EOT 04 04 ^D ENQ 05 05 ^E ACK 06 06 ^F Acknowledge BEL 07 07 ^G Bell or tone BS 08 08 ^H Backspace HT 09 09 ^I Horizontal Tab LF 10 0A ^J Line Feed VT 11 0B ^K Vertical Tab

Difference between Interface and abstract class

Introduction: Hi everyone, in this article I will explain what is abstract class & Interface, what their purpose and what is the difference between them. Back Ground: Before starting I want to give a brief wind up on something like 1. Class: It is a collection of methods, attributes, Properties etc., all the methods in the class are concrete classes (definition already exists). 2. Concrete Methods: A method which contains the implementation. EX:- Public void ConcreteMethod() { Console.WriteLine(“Method with Implementation”); } 3. Abstract Methods: opposite of abstract methods,i.e. method which does not have implementation or body. Ex:- Public void AbstarctMethod(); 4. As we know both the abstract class and interface cannot be instantiated, because these are used for implementing the inheritance (which mean to derive), because of this we can use these by deriving in our class. Abstract Class: Definition: This is a class, which is a combination of both concrete and abstract methods (