Skip to main content

Posts

Showing posts with the label Bad Image

How to use TabContainer in asp.net ajax

TabContainer and TabPanel TabContainer is an asp.net ajax control. TabContainer contain TabPanel objects. each TabPanel object represents a tab in TabContainer control. Tabs are used to organize the contents of TabContainer. this is a very useful tool when asp.net developers want to organize their page content in a small area. TabPanel object have two parts a Header and a Content area. tabs header can be define by HeaderText or HeaderTemplate. ContentTemplate define the tabs content which we want to display in tab. TabContainer have a great accessibility feature that we can access TabContainer by keyboard. we can navigate to different tabs by using keyboard left and right arrow keys. vertically displayed tabs can be navigate using keyboard up and down arrow keys. TabContainer have many built in properties such as ActiveTabIndex, Height, ScrollBars, TabStripPlacement, UseVerticalStripPlacement, VerticalStripWidth, AutoPostBack, OnDemand, CssClass, OnClient...

asp.net - How to change Panel horizontal align programmatically

Change Panel horizontal alignment programmatically The Panel represents a control that acts as a container for other controls. The Panel is especially useful when the asp.net developers want to generate controls programmatically, hide and show a group of controls, or localize a group of controls. The Panel’s Direction property is used to display text in the Arabic language. The following asp.net c# tutorial code demonstrates how we can change the horizontal alignment of a Panel web server control. Here we change the Panel’s horizontal alignment to center and right programmatically. In the below code example, we used the Panel control’s HorizontalAlign property to change its horizontal alignment programmatically. The Label HorizontalAlign property gets or sets the horizontal alignment of the contents within the panel. The HorizontalAlign property value is one of the HorizontalAlign values. The default value of this property is NotSet. Th...

How to change menu static item hover style in asp.net c#

Static hover style in menu control The Menu is an ASP.NET web server control. Menu control's StaticHoverStyle property gets a reference to the style object that allows us to set the appearance of a static menu item when the mouse pointer is positioned over it. This property value type is System.Web.UI.WebControls.Style. This Style represents the style of a static menu item when the mouse pointer is positioned over it. The StaticHoverStyle property has a few sub-properties. we can set the property both declaratively and programmatically. The declarative syntax is Property-Subproperty and the programmatic syntax is Property.Subproperty (StaticHoverStyle.BackColor). So we can set the static menu item hover style as setting the background color, text color, border style, border width, font name, text size, etc. The following ASP.NET C# example code demonstrates to us how can we set or change the Menu control's static menu items hover style...

asp.net - Change TreeView root node style programmatically

Change TreeView root node style programmatically The TreeView is an asp.net web server control. The TreeView is located under System.Web.UI.WebControls namespace. TreeView web server control displays hierarchical data. Such as a table of contents in a tree structure. The following asp.net c# tutorial code demonstrates how we can programmatically change the TreeView web server control’s root node style. The asp.net c# developers can set the TreeView root node style using its RootNodeStyle property. The TreeView RootNodeStyle property gets a reference to the TreeNodeStyle object that allows us to set the appearance of the root node in the TreeView control. The TreeView RootNodeStyle property value is TreeNodeStyle which is a reference to the TreeNodeStyle that represents the style of a node in the TreeView. The TreeNodeStyle class represents the style of a node in the TreeView control. The TreeView RootNodeStyle property controls the de...

asp.net - Change TreeView node style programmatically

Change TreeView node style programmatically The TreeView is an asp.net web server control. The TreeView is located under System.Web.UI.WebControls namespace. TreeView web server control displays hierarchical data. Such as a table of contents in a tree structure. The following asp.net c# tutorial code demonstrates how we can programmatically change the TreeView web server control’s node style. The asp.net c# developers can set the TreeView node style using its NodeStyle property. The TreeView NodeStyle property gets a reference to the TreeNodeStyle object that allows us to set the default appearance of the nodes in the TreeView control. The TreeView NodeStyle property value is TreeNodeStyle which is a reference to the TreeNodeStyle that represents the default style of a node in TreeView. The TreeNodeStyle class represents the style of a node in the TreeView control. The TreeView NodeStyle property controls the default appearance of a nod...

asp.net - Change TreeView leaf node style programmatically

TreeView leaf node style programmatically The TreeView is an asp.net web server control. The TreeView is located under System.Web.UI.WebControls namespace. TreeView web server control displays hierarchical data. Such as a table of contents in a tree structure. The following asp.net c# tutorial code demonstrates how we can programmatically change the TreeView web server control’s leaf node style. The asp.net c# developers can set the TreeView leaf node style using its LeafNodeStyle property. The TreeView LeafNodeStyle property gets a reference to the TreeNodeStyle object that allows you to set the appearance of leaf nodes. The TreeView LeafNodeStyle property value is TreeNodeStyle which is a reference to the TreeNodeStyle that represents the style of the leaf nodes in the TreeView. The TreeNodeStyle class represents the style of a node in the TreeView control. The TreeView control allows us to specify different style characteristics such...

asp.net - Programmatically show and hide CheckBox in a TreeView

Show and hide checkboxes in a TreeView programmatically The TreeView is an asp.net web server control. The TreeView is located under System.Web.UI.WebControls namespace. TreeView web server control displays hierarchical data. Such as a table of contents in a tree structure. The following asp.net c# tutorial code demonstrates how we can show and hide checkboxes in a TreeView control programmatically. The asp.net c# developers can change the checkboxes visibility of a TreeView programmatically using its ShowCheckBoxes property. The TreeView ShowCheckBoxes property gets or sets a value indicating which node types will display a check box in the TreeView control. The ShowCheckBoxes property value is a TreeNodeTypes. The TreeNodeTypes represent the different node types (leaf, parent, and root) in the TreeView control. The TreeView ShowCheckBoxes property value is a bitwise combination of the TreeNodeTypes values. The default is TreeNodeType....

asp.net - Change TreeView image set programmatically

Change TreeView image set programmatically The TreeView is an asp.net web server control. The TreeView is located under System.Web.UI.WebControls namespace. TreeView web server control displays hierarchical data. Such as a table of contents in a tree structure. The following asp.net c# tutorial code demonstrates how we can programmatically change the TreeView image set. The asp.net c# developers can change the image set of a TreeView programmatically using its ImageSet property. The TreeView ImageSet property gets or sets the group of images to use for the TreeView control. The ImageSet property value is one of the TreeViewImageSet values. The default is TreeViewImageSet.Custom. In this asp.net tutorial, we set the TreeView ImageSet property value to TreeViewImageSet.Faq and TreeViewImageSet.Msdn on button click event. The TreeViewImageSet.Faq is a predefined set of FAQ-styled images. And the TreeViewImageSet.Msdn is a predefined set ...

asp.net - Programmatically change a TreeView expand depth

Change TreeView expand depth programmatically The TreeView is an asp.net web server control. The TreeView is located under System.Web.UI.WebControls namespace. TreeView web server control displays hierarchical data. Such as a table of contents in a tree structure. The following asp.net c# tutorial code demonstrates how we can change the TreeView expand depth programmatically. The asp.net c# developers can change the expand depth of a TreeView programmatically using its ExpandDepth property. The TreeView ExpandDepth property gets or sets the number of levels that are expanded when a TreeView control is displayed for the first time. This property value is an Int32 which is the depth to display when the TreeView is initially displayed. The default is -1, which displays all the nodes. The asp.net c# developers need to use the TreeView ExpandDepth property to control the rendering of the TreeView control the first time that it is displayed. ...

asp.net - How to change HyperLink image url

Change HyperLink image URL programmatically The HyperLink is a control that displays a link to another Web page. The asp.net developers use the HyperLink control to create a link to another Web page. The HyperLink web server control is typically displayed as text specified by the Text property. But the asp.net c# developers can also display an image on it specified by the ImageUrl property. The following asp.net c# tutorial code demonstrates how we can change the HyperLink control’s image URL programmatically. In the below example code, we change the HyperLink control’s image URL programmatically using its ImageUrl property. The HyperLink ImageUrl property gets or sets the path to an image to display for the HyperLink control. The ImageUrl property value is a String that represents the path to the image to display for the HyperLink control. The default value of this ImageUrl property is an empty string (""). When asp.net devel...

asp.net - How to show tool tip on a HyperLink

Display a tooltip on a HyperLink The HyperLink is a control that displays a link to another Web page. The asp.net developers use the HyperLink control to create a link to another Web page. The HyperLink web server control is typically displayed as text specified by the Text property. But the asp.net c# developers can also display an image on it specified by the ImageUrl property. The following asp.net c# tutorial code demonstrates how we can show a tooltip on a Hyperlink control. In the below example code, we displayed a tooltip on the HyperLink control using its ToolTip property. The HyperLink ToolTip property gets or sets the text displayed when the mouse pointer hovers over the HyperLink web server control. The ToolTip property value is a String that represents the text displayed when the mouse pointer hovers over the Web server control. The default value of the ToolTip property is Empty. The HyperLink control’s ToolTip property is inherited ...

asp.net - How to change a HyperLink text programmatically

Change HyperLink text programmatically The HyperLink is a control that displays a link to another Web page. The asp.net developers use the HyperLink control to create a link to another Web page. The HyperLink web server control is typically displayed as text specified by the Text property. But the asp.net c# developers can also display an image on it specified by the ImageUrl property. The following asp.net c# tutorial code demonstrates how we can change the HyperLink text programmatically. Here we change the HyperLink text programmatically using its Text property. The HyperLink Text property gets or sets the text caption for the HyperLink control. The Text property value is a String that represents the text caption for the HyperLink control. The default value of the Text property is an empty string (""). In web browsers that support ToolTip functionality, the Text property also becomes the ToolTip. So finally, using the Hyp...

asp.net - How to use LinkButton click event

Click event in LinkButton control LinkButton is an ASP.NET web server control. The LinkButton server control renders a hyperlink-style button control on the web page. Though it looks like a hyperlink it has the same functionality as a Button control. By default, a LinkButton control is a submit Button. We also can use it as a command button. When we use LinkButton control as a regular submit button, we can provide an event handler for its Click event. Submit button simply posts the web page back to the server. This Click event allows us to programmatically control the action performed the submit Button (LinkButton) is clicked. The LinkButton Click event occurs when the LinkButton control is clicked. The click event is commonly used when no command name is associated with the LinkButton control. The LinkButton OnClick method raises the Click event of the LinkButton control. The OnClick method required a parameter named e. this parameter type is System.EventArgs ...

How to use DropDownList AutoPostBack in asp.net c#

DropDownList AutoPostBack Feature DropDownList control allows users to select an item from a single selection drop-down list. We can specify DropDownList items by placing ListItem elements between the opening and closing tags of the DropDownList control. The .NET developers can also populate DropDownList from a data source object such as SqlDataSource, ObjectDataSource, LinqDataSource, ArrayList, Array, etc. The DropDownList DataBind method binds the data source to the DropDownList control. Users can select an item from DropDownList and manually submit the form using submit button to send their selection to the server. This way we can get user selection by clicking a submit button. But ASP.NET DropDownList is a more user-friendly server control. It has a property name AutoPostBack. AutoPostBack property works with the SelectedIndexChanged event. AutoPostBack property gets or sets a value that indicates whether a postback to the server au...

How to use HyperLink in asp.net

HyperLink Web Server Control HyperLink is an asp.net web server control. we can display a hyperlink on a web form page by inserting a HyperLink server control on the page. HyperLink sever control can render as either text or as graphics. HyperLink control generates a link that allows users to navigate to another page or another location on the same page. NavigateUrl property value stores the link destination. To display hyperlink control as text we need to set the Text property value and to display as an image set the ImageUrl property value. If we set both ImageUrl and Text property values, ImageUrl takes precedence. HyperLink server control's other important property is the Target property. The .net developers can specify the frame or window to display the linked page by this Target property settings. Target property has four possible values those are _blank, _parent, _self, and _top. The _blank value displays the destination page in a new windo...

ASP.NET RegularExpressionValidator - Validate U.S. Social Security Number

RegularExpressionValidator to validate US Social Security Number The RegularExpressionValidator control validates whether the value of an associated input control matches the pattern specified by a regular expression. The following asp.net c# tutorial code demonstrates how we can validate a US Social Security Number. We used a RegularExpressionValidator control and a RequiredFiledValidator control to validate a specified United States Social Security Number. A RegularExpressionValidator control checks whether the value of an input control (as an example a TextBox) matches a pattern defined by a regular expression. The regular expression validation allows the asp.net c# developers to check for predictable sequences of characters, such as those in Zip Codes, telephone numbers, and emails. But there is an issue while validating using RegularExpressionValidator control. If the specified input control is left empty the regular expression va...

Validate an URL using RegularExpressionValidator in asp.net c#

URL validation using RegularExpressionValidator The RegularExpressionValidator control validates whether the value of an associated input control matches the pattern specified by a regular expression. The following asp.net c# tutorial code demonstrates how we can validate an URL. Here we will validate an URL by using the RegularExpressionValidator web server control. The RegularExpressionValidator web server control checks whether the value of an input control matches a pattern defined by a regular expression. This type of validation allows asp.net developers to check for predictable sequences of characters, such as those in email addresses, telephone numbers, and URLs. If the input control is empty, the validation will succeed. So, if a value is required for the associated input control, asp.net developers have to use a RequiredFieldValidator control in addition to the RegularExpressionValidator control. The RegularExpressionVal...

asp.net - How to filter file extension in FileUpload control

Upload file with specific extension FileUpload is an asp.net web server control that allows users to upload a file to a web server from their local computer file system. FileUpload control does not save files automatically to the server. FileUpload control's SaveAs() method allows us to save client-uploaded files to the web server file system. SaveAs() method needs to pass a parameter named 'filename'. By default, FileUpload control uploads any valid type file from the client machine. Sometimes .net developers need to restrict file type to upload. Such as in an application we can allow users to upload only JPEJ image files. Next, paragraphs describe how can we filter extensions when uploading a file to a web server. First, we specify the web server folder to save the uploaded file. Second, we check the FileUpload control contains a file by FileUpload HasFile property. This method validates FileUpload control in server-side code...