Floating FB popout byReview Results

Ravithkumar.com

Checkbox List in Dropdown

In this article we will see how to populate checkbox list in dropdown list.

Introduction: I am sure most of us have come across this requirement in our projects to select multiple items in dropdown list. I have created very lighter control with such features.

Copy the below code in your aspx page under body section. 

        <asp:TextBox ID="txtEmployee"  Text="Select Employee" runat="server" CssClass="textboxStyle" onclick="closepanel('block')">
</asp:TextBox> <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" /> <asp:Label ID="lblselected" runat="server"></asp:Label> <asp:Panel ID="Pnldetails" runat="server" CssClass="Panelstyle" style="display:none"> <table width="100%"> <tr> <td> <asp:CheckBox ID="chkAll" runat="server" onclick="check(this)" Text="Select All" /> </td> <td align="right"> <img src="images/Close.png" alt="Close" title="Close" onclick="closepanel('none')" /> </td> </tr> </table> <asp:Panel ID="pnlchkbox" runat="server" ScrollBars="Vertical" Height="150px" Width="250px"> <asp:CheckBoxList ID="chklstEmployee" runat="server"> <asp:ListItem>David</asp:ListItem> <asp:ListItem>John</asp:ListItem> <asp:ListItem>Stephanie</asp:ListItem> <asp:ListItem>McDonald</asp:ListItem> <asp:ListItem>James</asp:ListItem> <asp:ListItem>Peter</asp:ListItem> <asp:ListItem>Williams</asp:ListItem> </asp:CheckBoxList> </asp:Panel> </asp:Panel>

Read More

Godaddy Exception Details: System.Security.SecurityException: Request for the permission of type ‘System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral

I saw this frequest issue with godaddy hosting and there is no good support from godaddy.

After i researched a lot found that trust level should be added to web.config file when using .net frame work 4.0

Adding the following trust tag to your web.config will solve this issue.

<configuration>

<system.web>

<trust level=”Full” />

</system.web>

</configuration>

NumericUpDown Control

downloadUPDownControl.rar (18.90 kb)

Numeric Up Down:

Recently one of my friends asked me about the Numeric Up Down requirement.

Like we all know, I gave him suggestion to use the AjaxToolKit Numeric Uptown control.


Well that works fine. But his requirement was little bit different.

He wants user to select one of the values (15,30,45,60) using Numeric Uptown Control.

The AjaxToolKit Control will not support this functionality. Also I personally don’t like style of AjaxTookitControl  Number Updown Control.

AjaxToolkItControl reference: http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/NumericUpDown/NumericUpDown.aspx

 

So I got an idea of creating Custom Control using Javascript:

In this article I will explain about the functionality of this control also I will share the source code.

 Read More

T-sql ROW_NUMBER in Select Query

Syntax: 

ROW_NUMBER ( ) 
    OVER ( [ PARTITION BY value_expression , ... [ n ] ] order_by_clause )

Ex:select Row_Number() over(order by CustomerID asc) ROWNO, * from dbo.Customers


For More information please refer to the below Microsoft technet link
http://technet.microsoft.com/en-us/library/ms186734.aspx

Asp.net How to get the Drop Down List selected Item Value

There are couple of ways to select the required item from dropdownlist.
 
FindBYValue:
This is when you know the value of item, you want to select from the dropdown list items.
 DropDownList dropdownlist1 = new DropDownList();
dropdownlist1.Items.FindByValue("1").Selected = true;
Read More

Generics

In this topic I will try to explain what are generics, and I will show you some examples on how to work with generics

I asked a guy in an interview what are generics?  He replied smartly saying something which is not specific. Then I asked him how to you define specifics, he replied something which is not generic.. Innocent

Wasn’t that a tricky answer? let me give you a real world example. Read More

Jquery

In this post we will see some of the scenarios  and How to do using Jquery

 1) How to reset all the controls after the changes or to reset the form

function resetForm($form) {

        $form.find('input:text, input:password, input:file, select, textarea').val('');

        $form.find('input:radio, input:checkbox')

         .removeAttr('checked').removeAttr('selected');

           $(".field-validation-error").empty();

          $(".input-validation-error").empty();

    } Read More

KnockOutJS

Knockout is a JavaScript library that helps you to create rich, responsive display and editor user interfaces with a clean underlying data model. Knockout is called KO in short.
KO helps to build dynamic JavaScript UIs with MVVM and Asp.net
 
Bind text: text property used to display the data.
 
Data-bind is the keyword used to bind the data. In the below example I used H1 tag to display the Employee Name with help of text property. Observable property will automatically issue notifications whenever value changes. applyBindings used to apply the bindings. Copy the below code snippet to your page and check the output. Here in this example i have referenced to KnockOutJS file .3.0 version. You can download latest knockout js file from KnockOutjs website or Nuget and add it to your project.
        <h1 data-bind="text:employee">
            Employee</h1>
<script src="knockout-3.0.0.js" ></script>
        <script>
            var emp = { employee: ko.observable() };
            emp.employee('Naresh');
            ko.applyBindings(emp);
        </script>
Read More