Friday, 28 December 2012

Validating RadioButtonList using JavaScript

write the following code in your .aspx,

<script type="text/javascript">    
function validate()
{
var selected = $('#<%=RadioButtonList1.ClientID %> input:radio:checked').length;
if( selected>0){alert("valid");}
else{alert("Invalid");}
}
</script>

 <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
        <asp:ListItem>MALE</asp:ListItem>
        <asp:ListItem>FEMALE</asp:ListItem> </asp:RadioButtonList>



For any other queries feel free to post a comment.

Wednesday, 26 December 2012

A Beginner's Tutorial for Understanding Windows Communication Foundation (WCF) Part-5





Note: While using the source code, the service reference will have to be updated to added again as the address of the service that was being used was specific to my system. It could differ on other systems.
Points of interest
What we have tried to do here is to understand some basic concepts of a WCF service. We created a sample WCF service. We have also created a sample website to consume the WCF service.
There are various alternatives when it comes to hosting, accessing, and using a WCF service. We have only looked at one particular way. One good exercise would be to change this service to make it accessible via AJAX. It is more like a WCF service involves some code and some configuration. If we need to use different sets of ABCs for this service, then the code (logic) will not change, the only change that will be required is in the configurations.