Skip to main content

Posts

How to use ListView control in asp.net

ListView Web Server Control ListView is an ASP.NET web server control. ListView allows us to data bind with DataSource and display data. We can show ListView data items on pages. ListView can display data items individually or it can group data items. .NET developers can format data using templates and styles in a ListView control. ListView is popular for displaying data in any repeating structure. It is a similar server control to the DataList and Repeater server control. But ListView has more facilities such as the user can edit, update, insert, delete, sort, and even page data. All those are ListView built-in features, so you don't need to code for any one facility. LisView can data bind with SqlDataSource control using its DataSourceID property. By binding data with data source control we can get its built-in advantage such as paging data, sorting data, inserting, deleting, and editing data. ListView DataSource property allows us...

cfqueryparam- how to use cfqueryparam in cfquery tag

cfqueryparam Usingcfqueryparam.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfqueryparam- how to use cfqueryparam in cfquery tag</title> </head> <body> <h2 style="color:DarkBlue; font-style:italic">ColdFusion cfqueryparam tag example: how to use cfqueryparam</h2> <hr width="600" align="left" color="PowderBlue" /> <br /> <cfparam name="url.BookID" default="0"> <cfquery name="Books" datasource="cfbookclub"> select BookID, Title from Books where BookID = <cfqueryparam value="#url.BookID#" cfsqltype="cf_sql_integer"> </cfquery> <div style="font-family:'Courier New', Courier, monospace; font-size:large;"> <a href=...

How to use cfsqltype in cfqueryparam tag in ColdFusion

CFqueryparam and CFsqltype Usingcfsqltype.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfqueryparam and cfsqltype - how to use cfsqltype in cfqueryparam tag</title> </head> <body> <h2 style="color:DarkBlue; font-style:italic">ColdFusion cfqueryparam tag example: how to use cfsqltype</h2> <hr width="600" align="left" color="PowderBlue" /> <br /> <cfparam name="url.EmpID" default="0"> <cfquery name="qEmploees" datasource="cfdocexamples"> select Emp_ID, FirstName, LastName from Employee where Emp_ID = <cfqueryparam value="#url.EmpID#" cfsqltype="cf_sql_integer"> </cfquery> <div style=" font-family:'Lucida Sans Unicode', 'Lu...

How to cache query data in session scope in ColdFusion

Session scopes query caching - cache query data in session scope QueryCacheSessionScope.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Session scopes query caching - how to cache query data in session scope</title> </head> <body> <h2 style="color:Crimson; font-style:italic">ColdFusion query caching example: how to cache query in session scope</h2> <hr width="600" align="left" color="LightPink" /> <br /> <!--at first enable session management in application.cfm file--> <cfset Session.UserName="cfsuman"> <cfquery name="Session.Authors" datasource="cfbookclub" maxrows="2"> select AuthorID, FirstName, LastName from Authors </cfquery> <cfdump var="#Session#...

How to use NOT EQUAL operator in cfif condition in ColdFusion

Introduction In ColdFusion web development, control flow plays a critical role in dictating the behavior of web applications based on specific conditions. One of the most fundamental ways to manage this control flow is through the cfif tag, which allows for the evaluation of conditions and the execution of corresponding blocks of code. In this tutorial, we explore how to use the "NOT EQUAL" operator within a cfif condition. This operator enables developers to execute different blocks of code when two values do not match, making it an essential tool for implementing conditional logic in ColdFusion applications. This article will break down the example code step-by-step to explain the key elements involved, from defining variables to styling the output. By the end of this guide, you’ll have a better understanding of how the "NOT EQUAL" operator works within ColdFusion’s cfif structure, and how you can apply this in your own web development projects. Variable Declar...

How to use NEQ operator in cfif condition in ColdFusion

CFif NEQ operator cfifNEQOperator.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfif NEQ operator - how to use (NEQ) operator in cfif condition</title> <style type="text/css"> .divCSS { background-color:Crimson; color:White; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-size:large; width:400px; height:60px; text-align:center; padding-top:10px; border:thick; border-style:dotted; } </style> </head> <body> <h2 style="color:SeaGreen; font-style:italic">coldfusion cfif tag example: how to use "NEQ" operator</h2> <hr width="575" align="left" color="LawnGreen" /> <br /> <cfset UserRole="Guest"> <div class="divCSS...

ColdFusion - How to use IS NOT operator in cfif conditional processing

CFif IS NOT operator cfifISNOTOperator.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfif IS NOT operator - how to use (IS NOT) operator in cfif conditional processing</title> <style type="text/css"> .divCSS { background-color:DeepPink; color:Snow; font-family:"Courier New", Courier, monospace; font-size:large; width:450px; height:75px; text-align:center; padding-top:25px; } </style> </head> <body> <h2 style="color:SeaGreen; font-style:italic">coldfusion cfif tag example: how to use "IS NOT" operator</h2> <hr width="550" align="left" color="DarkSeaGreen" /> <br /> <cfset PreferedColor="DodgerBlue"> <div class="divCSS"> ...