Friday, April 19, 2013

"why Bush hid the facts" showing bug?

 This  Problem  because  of  some  certain combination  and  frequency of  letters in character  string  because "Notepad" misinterpret the encoding of the file when it is re-opened. There  are  lot  of  other  reason  because  using  of  Unicode characters.  Previous  version  of  notepad  not  using  UNICODE thats  why  error  will  not  come  using  previous  version.

for  more  details. visit  this  website
http://www.hoax-slayer.com/bush-hid-the-facts-notepad.html

HAPPY CODING

why we can't create folder with name 'con'?

Hi,

You can't make folders on the desktop that have "System Action" or "Device"  references such
as con, nul and prn. Solution is to use another name or use 0 instead of o,O for C0n.

Here are others :

CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9,
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9

Can you create “con” folder on windows os ?
http://freetechjournal.com/windows-tips/create-con-folder-windows-xp-os.html

HAPPY CODING

Wednesday, April 10, 2013

How to get/set Selected Values of Select2 Multi Selection List in MVC?

Hi 
Here  you  can  get  selected element of  Multi selection list  using  Select2 Jqyery.

Jquery Code

var AuthorList=  $("select#AuthorList").select2("val");
-----------------------------------------------------------------------

2. How to set MultiSelection List?

    First  Get  Selected  value  from  your  database  and  add  into   Hidden Field
like.



Then
Var authlist="";
  var a_options = [];

        $.each($("#AuthorListoption"), function () {
            if (authlist.toLowerCase().indexOf($(this).attr("value")) >= 0) {
                a_options.push($(this).attr("value"));
            }

        });

        $("select#AuthorList").select2("val", a_authlist);

HAPPY CODING



How To Bind MultiSelection List with Select2 Jquery in MVC

Action
------------------
Public ActionResult Author()
{
     SelectList AuthorList= null;
            IEnumerable Author = AuthorList.AsEnumerable().Select(c => new SelectListItem()

           {
               Text = objauth.ReplaceTagValueToTerm(c.TagValue, c.Term),
               Value = c.Id.ToString(),
               Selected = true,
           });
           Newterms = new SelectList(Author, "Value", "Text");
            ViewBag.AuthorList= Newterms;
}
}

-------------------------------------------------------------------------------------
View Page
     @Html.DropDownList("infoTypes", (SelectList)ViewData["AuthorList"], new { @class = "NewCssdropdown", multiple = "" })
---------------------------------------------------------------------
Jquery

  $("#AuthorList").select2(
        {
            maximumSelectionSize: 4 //  Here You can define maximum selection


        });


HAPPY CODING