Click here to Skip to main content
15,911,139 members

Comments by Member 8547973 (Top 6 by date)

Member 8547973 20-Apr-15 1:57am View    
Please give any idea sir.
Member 8547973 20-Apr-15 0:38am View    
void comPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
//determine the mode the user selected (binary/string)
switch (comm.CurrentTransmissionType)
{
//user chose string
case CommunicationManager.TransmissionType.Text:
//read data waiting in the buffer
string msg = comPort.ReadExisting();
//display the data to the user
DisplayData(CommunicationManager.MessageType.Incoming, msg + "\n");
break;
//user chose binary
case CommunicationManager.TransmissionType.Hex:
//retrieve number of bytes in the buffer
int bytes = comPort.BytesToRead;
//create a byte array to hold the awaiting data
byte[] comBuffer = new byte[bytes];
//read the data and store it
comPort.Read(comBuffer, 0, bytes);
//display the data to the user
DisplayData(CommunicationManager.MessageType.Incoming, comm.ByteToHex(comBuffer));
break;
case CommunicationManager.TransmissionType.Ascii:
//retrieve number of bytes in the buffer
int bytess = comPort.BytesToRead;
//create a byte array to hold the awaiting data
byte[] comBufferr = new byte[bytess];

//read the data and store it
comPort.Read(comBufferr, 0, bytess);
//display the data to the user
DisplayData(CommunicationManager.MessageType.Incoming, comm.ByteToString(comBufferr) + "\n");

break;
default:
//read data waiting in the buffer
string str = comPort.ReadExisting();
//display the data to the user
DisplayData(CommunicationManager.MessageType.Incoming, str + "\n");
break;
}
}
Member 8547973 2-Jan-14 5:52am View    
1. $("#ContentPlaceHolder1_txtPreCity").autocomplete() /* This is work* /
2. $("#ContentPlaceHolder1_txtCity").autocomplete() /* This is not work* /

if change the 1 function replace by 2 and 2 replace by 1 then 2 worked but 1 not worked
Member 8547973 2-Jan-14 5:44am View    
$(document).ready(function () {
$("#ContentPlaceHolder1_txtPreCity").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "member-registration.aspx/GetCity",
data: "{'_countriesId':'" + document.getElementById("#ContentPlaceHolder1_txtPreCity").value + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error");
}
});
},
minLength: 1,
focus: function (event, ui) {
$("#ContentPlaceHolder1_txtPreCity").val(ui.item.Name);
return false;
},
select: function (event, ui) {
$("#ContentPlaceHolder1_txtPreCity").val(ui.item.Name);
$("#ContentPlaceHolder1_txtPreCity").val(ui.item.value);
return false;
}
}).data('autocomplete')._renderItem = function (ul, item) {
return $('<li>').data('item.autocomplete', item).append('' + item.Name + '').appendTo(ul);
};
$("#ContentPlaceHolder1_txtCity").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "listofoba.aspx/GetCity",
data: "{'_countriesId':'" + document.getElementById("#ContentPlaceHolder1_txtCity").value + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error");
}
});
},
minLength: 1,
focus: function (event, ui) {
$("#ContentPlaceHolder1_txtCity").val(ui.item.Name);
return false;
},
select: function (event, ui) {
$("#ContentPlaceHolder1_txtCity").val(ui.item.Name);
$(".ContentPlaceHolder1_txtCity").val(ui.item.value);
return false;
}
}).data('autocomplete')._renderItem = function (ul, item) {
return $('<li>').data('item.autocomplete', item).append('' + item.Name + '').appendTo(ul);
};
});
Member 8547973 2-Jan-14 5:33am View    
Thank you sir for answer. but problem is, first function call and second function not call in sequence.