Saturday, May 10, 2014

JQuery Allow specific number of Alphabets into text box in asp.net

Title:Allow only number of Alphabets in to Text box in asp.net using JQuery

Description:
As in previous article ,we have validated the text box which has to hold some value while doing the insertion.Now i would like describe and give an example on JQuery validation ,which will allow only 10 characters into text box.So here i will put condition text box length while performing the validation i:e is less then 10 ,it will show error message through alert box

Example:
<html>
<head runat="server">
<script type="text/javascript" src="Javascript/jquery-1.3.1.min.js"></script>
<script type="text/javascript" language="javascript">

$(document).ready(function() {

$('#allowOnlyChars').click(function() {

if ($("#OnlyChars").val().length < 10) {

alert('Valid data'+"#OnlyChars").val());

return true
}
else {
alert('Please: you should enter only 10 characters')
return false;
}
})
});
</script>
</head>
<body>
<form id="validateForm" runat="server">
<asp:TextBox ID="OnlyChars" runat="server"></asp:TextBox>
<asp:Button ID="allowOnlyChars" runat="server" Text="Validate" OnClick="allowOnlyChars_Click" />
</form>
</body>
</html>

Monday, April 28, 2014

JQuery validate textbox in asp.net


Title : How to validate text box using JQuery in asp.net

Description : Why we have to apply validation on input control?Because of this functionality we can restrict the input data as per our need.Now we will see how to do the validation using client side script(JQuery).If we want to develop the validations in asp.net we have to use validation 
control for specified control.

Example:
<html>
<head runat="server">
<script type="text/javascript" src="Javascript/jquery-1.4.1.min.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#doValidate').click(function() {
if ($("#allowData").val()!="") {
alert('Enter Text'+"#allowData").val());
return true
}
else {
alert('Please enter valid data')
return false;
}
})
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="allowData" runat="server"></asp:TextBox>
<asp:Button ID="doValidate" runat="server" Text="Validate" OnClick="doValidate_Click" />
</form>
</body>
</html>


Friday, August 30, 2013

DataBinding in windows Forms in asp.net using C#.net

Title:Data binding for windows form using C#

Description:
Data Binding is the concept if providing address of memory location to a control for presenting data.This will reduce coding burden on developer and makes development faster.Below image can give the brief idea on it
Each window for will maintain binding context component.Binding context component will manage currency manager components,Currency manager will maintain record pointer to data-set table,it supports navigation and manipulations,It will place data into Bound Control.
Here the currency manager acts like mediator  between  bound control and memory block

There are two type of data binding con concepts,
1.Simple data binding
2.Complex data binding

Using Simple data binding,control can be bind to only single element.Complex data binding can be bind to more than single element

Tuesday, August 27, 2013

How to use For loop in C#.net

In this articles i will show how to use looping statement in c#.net.In this examples A program to add to textBox at run time. Here i placed one button to perform click event.
code for button click
{
int x=30;
for(int i=1;i<=10;i++)
{TextBox txt=New TextBox();
txt.Text="Txxt"+i;
txt.Location=New Point(100,x);
This.Controls.Add(txt);
x=x+30;
}
In the above code i created 10 text box using for loop condition.The for loop condition takes maximum iteration up to 10 which i was given at condition


Wednesday, August 14, 2013

Datasource Controls in Asp.net


The data source controls are available from asp.net 2.0(Not bound controls).Using this controls we can automate the task of creating data object.Normally we have to prepare data object programatically(using code).Whenever use these controls we may get some question regarding wizard approach features then one programmatic object will be created most importantly these controls provide complete customization options.The following data source controls are available in Asp.net

1.SQL Data source control
2.LINQ Data source control
3.Object Data source control
4.XML Data source control
5.Ado.net entity framework Data source control

1.Sql Data source control:
it is used to prepare data object from any sql supported database Oracle,Sqlserver,Access,My sql,SYSbase,informix,ingres etc

Note:

Features:
The DS controls supports caching features . Data source controls does not Cache any data.with enable cache property of it we can add caching support.The reason to cache data is to avoid DB trips for every request.If data is cached then we retrieve data from they cache only by avoiding db.This will improve performance like anything.Different property for caching are also supported for maintaining time ,dependency etc
Conflict Detection(Concurrency control)
Using Data source controls when we manipulate data there is every possibility of occurring concurrency problems because web is for all and also our form can be accessed many users . DS controls provide conflict detection with 2 option

i)Override changes
ii)Compare all values