Saturday, November 19, 2011

Allow only numeric values from Keyboard using jquery

Title: How to allow only number in asp.net using JQuery

Description:As we know this is the validation kind of functionality of a control in any web application.the below example will describe how to allow only number when you click on the keyboard.So the required field will not the characters from the board

function NumericOnly(e) {
var presskey;
if (navigator.appName.lastIndexOf("Microsoft Internet Explorer") > -1)
presskey= e.keyCode;else
presskey= e.which;if ((presskey== 0 || presskey== 8 || presskey== 9))       
return true;
if ((presskey> 47 && presskey< 58))
return true;
else { e.returnValue = null; return false;
}
}

Jquery div inline datepicker

In previous post i have given example on how to develop jquery autocomplete. In this post i will given how to use jquery date picker library on Div.The jquery  date picker would be  assign to the different controls and div's  using below jquery function.Here i will shown how to assign the data picker to div using jquery.
function(tar, inst) {
var divSpan = $(tar);
if (divSpan.hasClass(this.markerClassName))
return;
divSpan.addClass(this.markerClassName).append(inst.dpDiv).
bind("setData.datepicker", function(event, key, value){
inst.settings[key] = value;
}).bind("getData.datepicker", function(event, key){
return this._get(inst, key);
});
$.data(target, PROP_NAME, inst);this._setDate(inst, this._getDefaultDate(inst));
this._updateDatepicker(inst);
this._updateAlternate(inst);
}

Transaction handling in .net

Transaction is a unit of manipulation on the basis of all .This is recommended when the manips are interrelated
Ado .net is providing transaction class and begin transaction method with connection class to implement transaction handling.

I have given a simple example on transaction handling .For this i have used three text boxes and  one button in windows application.

Transaction.aspx.cs :
Dim con As New SqlConnection("userid=sa;passed=;databse=invetary")
Dim cmd As New SqlCommand()
Dim t As SqlTransaction

Try
con.open()
t=con.BeginTransaction()
cmd.connection=con
cmd.Transaction=t
cmd.commandText="insert into trans values("&t1.text&","&t2.text&","&t3.text&")"
cmd.excutionQuery()
cmd.CommandText="update item set Qoh=qoh="&t3.text&" where itemno="&t2.text""
Dim n As byte
n=cmd. excutenonQuery()
if n=0 then
Throw New invalidTransException("item not found")
End if
t.Commit()
msgbox("Transaction Successfully")

Catch ex As Exception
t.rollback()
msgbox("Trans failed"&ex.message)

Finally
con.close()

EndTrancation
End Sub
End Class

Friday, November 18, 2011

“don’t allow remote connections ” error


 In previous articles i explained how to solve a network related or instance specific error .If we get error like “don’t allow remote connections ”or A connection was successfully established with the server, but then an error occurred during the login process in sql server 2005,we have to change the remote connections ,we have to change the Remote Connections in sql server.

Do the below steps to resolve this issue:
1.Goto MicrosoftSqlServer2005->Configuration Tools
2.select SqlServer Surface Area Configuration
3.select the data base what you have used in sytem
4.Then select the remote connection.Here we can see three options,In these we have to select using both TCP/IP and names pipes


Thursday, November 17, 2011

Create a Page layout(aspx page) in ektron CMS

In this article i will shown how to create Page lay out in ektron cms .For doing this  we have to login into cms work area.Then select the Content tab which is at top of the work area page.
 Then Select the page layout option in new tab in content area.Whenever click on that option we will get a pop up  to select the master page lay out for this page .Here  we can change the folder path which one we will want to add to  this  page lay out


There is a button to go for the next step .When ever click on the next button we will get one more pop which is contains the options to give a name of the page ,taxonomy and meta data.The page will be created when we complete these steps

Bel