i m feelin these days that in a day we have "only " 24 hours ?
Tuesday, August 7, 2012
does method signature include return type in C sharp (c#)
does method signature include return type in C sharp (c#)
I would say BIG NO
I read a lot of blogs and finally i have decieded to test by self and i just make some simple code
when i run this its throws error
already defines a member called 'sum' with the same parameter types
but if i change the parameter type then its runs OK
so final result is method signature not include return type. and a method can be not overloaded just by changing its return type .
I would say BIG NO
I read a lot of blogs and finally i have decieded to test by self and i just make some simple code
protected int sum(int a, int b)
{
return a + b;
}
protected float sum(int a, int b)
{
return a + b;
}
when i run this its throws error
already defines a member called 'sum' with the same parameter types
but if i change the parameter type then its runs OK
so final result is method signature not include return type. and a method can be not overloaded just by changing its return type .
what is the difference between wcf service and web service?
WCF is a programming model and API.
"WCF Service" implies an app that is built using that programming model and API.
"Web Service" is an app that exposes an HTTP (REST (XML or JSON), SOAP or otherwise) interface.
You can build a Web service using WCF, but you can also build a Web service using other APIs or "stacks". Like PHP or Java, for example.
With WCF you can build web services but you can also build services that are not, "Webbish". For example you can build a service that accepts incoming binary requests over only a local pipe interface. It is still a service, but it is not a "web service" because it is not using web protocols (generally HTTP and XML).
reference
"Web Service" is an app that exposes an HTTP (REST (XML or JSON), SOAP or otherwise) interface.
You can build a Web service using WCF, but you can also build a Web service using other APIs or "stacks". Like PHP or Java, for example.
With WCF you can build web services but you can also build services that are not, "Webbish". For example you can build a service that accepts incoming binary requests over only a local pipe interface. It is still a service, but it is not a "web service" because it is not using web protocols (generally HTTP and XML).
reference
Friday, July 27, 2012
Get checkboxlist selecte items in a string with comma seprated
this is code to get selected items in checkbox list as a string separated with comma or any delimeter you want to use like |(Pipe singn)
var selectedValues = (from item in chbBroadType.Items.Cast() where item.Selected select item.Value).ToArray();
var selectedValuesJoined = string.Join(",", selectedValues);
Get count of checkboxlist selected items
this is single line of code that can be used to get the number of items selected in checkboxlist in asp.net with c#
int count= ChbProperty.Items.Cast<ListItem>().Count(li => li.Selected);
Sunday, July 22, 2012
How to get java script variable value on server side
The answer is Hidden field or any input control.
You just need to take hidden field and set the value of java script variable on hidden filed .like below
You just need to take hidden field and set the value of java script variable on hidden filed .like below
var javascriptvariable='some value';
$('#hiddenfield').val(javascriptvariable);
Now on server side you can get the hidden field which is
actually java script variable value
String hdnvalue=
hiddenfield
.value;
I have used Jquery val function to set the value .
You can use val function of jquery in
two ways to get the value just use the
$('#hiddenfield').val(
)
and for setting the value you need to pass
the value as argument in val function
like this
$('#hiddenfield').val(
'31october')alert($('#hiddenfield').val(
) );
you can check live demo here .
http://jsfiddle.net/VaKfP/255/
I love http://jsfiddle.net/ for jquery code sharing.
Thanks
Subscribe to:
Posts (Atom)
ASP.NET Core
Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...
-
The error message you encountered ("DeleteService FAILED 1072: The specified service has been marked for deletion") indicates tha...
-
replace html of a div using jquery this is simple . just use .html() method of jquery to set new html for a div . $ ( "#divID...
-
declare @ProductIds nvarchar(50)='18,19' SELECT * FROM products Where (',' + @ProductIds +',' LIKE '%,' ...