Wednesday, December 21, 2011

How to Bind the DropDownList With Enum

0 comments 12/21/2011
We can Bind DropDownList with no of ways, Now I am going to show how to bind dropdown using ‘enum’. 

Check This How To Bind DropDownList Using List Collection and DataSet in Asp.Net



 Let’s take Countries ‘enum’ as follows

enum enCountries:int{India=0,USA,UK,UAE};

Let see How to Bind the DropDownList With Enum



ddlEnumBind.Items.Add("--Select Country--");

   //get enum items to get the respective enum value
   string[] enumNames=Enum.GetNames(typeof(enCountries));
   foreach (string item in enumNames)
   {
       //get the enum item value
       int value = (int)Enum.Parse(typeof(enCountries), item);
       ListItem listItem = new ListItem(item, value.ToString());
       ddlEnumBind.Items.Add(listItem);
   }
Read More»

Thursday, June 9, 2011

Blogger New Futures Are Available @ Draft

0 comments 6/09/2011
Blogger already promises to introduce more new futures in this year. Today my Blogger dashboard becomes more powerful with new features and look.


Just see the Screen shots of my new Dashboard








Read More»

Saturday, May 28, 2011

How To Bind DropDownList Using List Collection and DataSet in Asp.Net

0 comments 5/28/2011
We can bind DropDownList in Different ways by using List, Dictionary and DataSet.

To bind DropDownList we need to set some properties
DataSource
DataValueField
DataTextField
Let see how to use these properties to bind DropDownList

Binding DropDownList with List

In This Case the DropDownList both 'Value' and 'Text' field are same.

DropDownList ddl = new DropDownList();
List<string> countries = new List<string>();
countries.Add("USA");
countries.Add("India");
ddl.DataSource = countries;
ddl.DataBind();

Binding DropDownList with Dictionary

Dictionary<string, string> States = new Dictionary<string, string>();
States.Add("-1","-Select State-");
States.Add("AP", "Andhra Predesh");
States.Add("KA", "Karnataka");
States.Add("TN", "Tamilnadu");
States.Add("KL", "Kerala");
ddl.DataSource = States;
ddl.DataValueField = "Key";
ddl.DataTextField = "Value";
ddl.DataBind();

Binding DropDownList with DataSet

My DataSet Contains a Class table(class_id,class_name,description)
ddl.DataSource = dataset.Tables[0].DefaultView;
ddl.DataValueField = "class_id";
ddl.DataTextField = "class_name";
ddl.DataBind();
ListItem item = new ListItem("-Select Class-", "-1");
ddl.Items.Insert(0, item);

Happy Coding
Read More»

Thursday, April 28, 2011

jQuery Toggle Button Widget For Blogger

2 comments 4/28/2011
jQuery is Most Powerful and useful Library.In my blog i used jQuery to Develop no of widgets for making more useful and attractive.

List of jQuery Widgets for Blogger

In this article i am going to show how add a toggle widget for Blogger.

jQuery Toggle

Step 1:Login to Blogger dashboard » layout » Edit HTML

Find(CTRL+F) ]]</b:skin>tag.

Now copy and paste below code just before ]]</b:skin> this.

/* TT- Start Toggle Div CSS */
div.toggle_head {
padding: 0px 3px 0 15px;
margin: 0 0 0px 0;
margin-top:10px;
background: #0080FF url(https://lh4.googleusercontent.com/_-A4vw5BwqxA/TZmBZf6FvRI/AAAAAAAAFcs/dJzL2rz1KpY/minus.jpg) no-repeat right center;
height: 25px;
line-height: 25px;
width: 94%;
border-radius: 5px 5px 0px 0px;
float: left;
_float: none;
/* Float works in all browsers but IE6 */
border: 1px solid #999;
border-bottom: 1px solid #ccc;
cursor: pointer;
border-radius:5px;
color:#ffffff;
vertical-align:center;
}
div.toggle_head li {
padding-top:6px;
color: #ffffff;
display: block;
font: bold 12px Arial, Tahoma, Verdana;
text-transform: uppercase;
vertical-align:center;
}
div.toggle_head li:hover {
color: #000000;
border-radius: 5px 5px 5px 5px;
font: bold 12px Arial, Tahoma, Verdana;
text-transform: uppercase;
vertical-align:center;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
div.toggle_active
{
border-radius: 5px 5px 5px 5px;
padding: 0px 3px 0 15px;
background: #0080FF url(https://lh5.googleusercontent.com/_-A4vw5BwqxA/TZmBZahS8rI/AAAAAAAAFcw/p49jXBjARvI/pluse.jpg) no-repeat right center;
font: bold 12px Arial, Tahoma, Verdana;
text-transform: uppercase;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.toggle_body {
margin: 0 0 0px;
padding: 0;
border-top: 1px solid #d6d6d6;
background: #f0f0f0 url(toggle_block_stretch.gif) repeat-y left top;
overflow: hidden;
font-size: 1.2em;
width: 100%;
clear: both;
}

/* TT- End Toggle Div CS S*/
»If you want customize the Tabbed Widget colors just Follow the comments to Change the colors

»Simply replace these colors with your custom colors in the above code respectively.

Step 2:Find </head>; .

Cope and paste the below just before </head> this.
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js' type='text/javascript'/>
<script type='text/javascript'>
/*----------Start TechTasks Toggle Script--------------*/
$(document).ready(function(){
$("#toggle_head").click(function() { $(this).toggleClass("toggle_active").next().slideToggle("slow");
});
});
/*-------- End TechTasks Toggle Script------*/
</script>

Step 3:Find <div id='sidebar-wrapper'> or <div id='sidebar' > ;

If u can't find above code don't bother about that,Coz template designers are developed different ways.Just find the starting <Div> of Sidebar

Now copy and paste below code just below that.
<div class='toggle_head' id='toggle_head'><li>Poll</li></div>
<div class='toggle_body' id='toggle_body'>
<b:section class='sidebar' id='toggle' preferred='yes'>

</b:section>
</div>

Finally Save the Template.

Then Go to your page Elements Page and add the widgets for your accordion.


Your comments and suggestions are most encouraging thing for me to write more articles.

Happy Blogging.
Read More»

Saturday, April 16, 2011

Very Interesting Windows Magical Bugs

0 comments 4/16/2011
Today i got mail notifying about very interesting and amazing Magical bug in WINDOWS

MAGIC #1

An Indian found that nobody can create a FOLDER anywhere on
the Computer which can be named as "CON". This is
something funny and inexplicable? At Microsoft the whole
Team, couldn't answer why this happened!
TRY IT NOW, IT WILL NOT CREATE A "CON"
FOLDER



MAGIC #2

For those of you using Windows, do the following:

1.) Open an empty notepad file
2.) Type "Bush hid the facts" (without the quotes)
3.) Save it as whatever you want.
4.) Close it, and re-open it.

Noticed the weird bug? No one
can explain!

MAGIC #3

Again this is something funny and can't be explained?
At Microsoft the whole Team, including Bill Gates,
couldn't answer why this happened!

It was discovered by a Brazilian. Try it out
yourself?

Open Microsoft Word and type

=rand (200, 99)

And then press ENTER
And see the
magic?..!



MAGIC #4

Did you know that a flight number from one of the planes that hit one of the two WTC towers on 9/11 was Q33N. In Notepad / WordPad or MS Word, type that flight number i.e Q33N. Increase the font size to 72. Change the font to Wingdings. ….. u will be amazed by the findings!!!…………………..



i got two Magics only can u try and let me about other also.

Read More»
  • Friends
  • Poll
  •  

    Recent Posts

    New Comments

    Copyright 2008 All Rights Reserved Tech Tasks Template by Rajesh Kumar Chekuri

    Share
    Me
    Twitter Delicious Digg Stumbleupon Facebook More

    Connect to TT Facebook
    Back to Top