Skip to main content

Posts

Showing posts with the label linkbutton

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 ...

asp.net - How to submit a form with a LinkButton

Submit an asp.net page by LinkButton control LinkButton is an ASP.NET web server control. LinkButton control display as a hyperlink-style Button control on the web page. LinkButton server control has the same appearance as a hyperlink control but it has the same functionality as a regular button control. We can render LinkButton control as a Submit button or as a Command button on the web page. So we can submit an ASP.NET page to the web server by LinkButton control. Submit button does not have a command name associated with it. By default, LinkButton control is a submit Button that simply posts the web page back to the server. We can provide an event handler for the LinkButton Click event to programmatically control the action performed when the submit Button is clicked. The LinkButton Click event occurs when the LinkButton control is clicked. The following ASP.NET C# example code demonstrates to us how can we submit an ASP.NET page to the w...

asp.net - How to DataBind a CheckBoxList with an array

DataBind a CheckBoxList with array The following ASP.NET C# example code demonstrates to us how can we data bind a CheckBoxList web server control programmatically at run time with an Array data source object. CheckBoxList is an ASP.NET list web server control. CheckBoxList allows web users to select/check one or more items at a time. CheckBoxList contains ListItem objects. Each ListItem object represents an item. We can populate a CheckBoxList from Array elements. To do this, first, we need to initialize an array object. Then we populate the Array with items (elements). Next, we need to specify the newly created Array as CheckBoxList control's DataSource. Finally, we can data bind CheckBoxList control with Array by calling the CheckBoxList DataBind() method. The populated CheckBoxlist creates the same number of items as the number of elements that exist in the Array. Each Array element creates an item in CheckBoxList. We populated CheckBoxL...