This is just a quick post to show how to set dropdown value by text using jquery.
This is a method that works based on the text of the option, not the index.
$("#YourDropDownId option").each(function() {
if($(this).text() == TextToBeDisplayOrSelected) {
$(this).attr('selected', 'selected');
}
});
Special Thanks To : Stackoverflo...
Tuesday, September 27, 2016
Thursday, July 2, 2015
How to get image URL via C# from site-core
This is just a quick post to show how to get image URL via code behind C#.
This is mostly useful when you are binding children items to a repeater or returning image URL in a JSON web-service.
public static string GetImageURL(Item currentItem)
{
string imageURL = string.Empty;
Sitecore.Data.Fields.ImageField imageField = currentItem.Fields["Image"];
if (imageField != null && imageField.MediaItem != null)
{
Sitecore.Data.Items.MediaItem image = new Sitecore.Data.Items.MediaItem(imageField.MediaItem);...
Thursday, March 12, 2015
8:11 AM
By Kannan
By Kannan
HTML Button onserverclick fired twice in ASP.NET UpdatePanel
Old Code:
id="myButton" runat="server"onserverclick="myButton_ServerClick" >Save
New Code:
button nbsp="" span="" type="button">id="myButton" runat="server"onserverclick="myButton_ServerClick" >Save
Just change button type to button from submit and issue is resolved...
Tuesday, June 16, 2009
To Create a DropDownList from an ENUM

You have an 'Enum' defined as follows:public enum CompanyAddressType { Unknown = 0, Primary = 1, Warehouse = 2, Distribution_Center = 3, Cross_Dock = 4 }You want to iterate through the list and put the data into an asp.net DropDownList.Here is the simple code:protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string[] names = Enum.GetNames(typeof...
Saturday, May 23, 2009
ஜிமெயில் ஷார்ட் கட் கீகள்
உங்களுடைய ஜிமெயில் அக்கவுண்ட்டை மவுஸ் கொண்டு செலுத்துவதற்குப் பதிலாக கீ போர்டு ஷார்ட் கட் கீகள் மூலம் செயல்படுத்தலாம். இந்த கீ போர்டு ஷர்ர்ட் கட் கீகளைப் பயன்படுத்துவதனால் நம் நேரம் மிச்சமாகிறது. மேலும் கீ போர்டிலிருந்து கைகளை எடுக்காமல் விரைவாக நம்மால் செயல்பட முடியும். இதோ சில ஷார்ட் கட் கீகள்:F : கீயை மட்டும் அழுத்தினால் இமெயில் செய்தியை அடுத்ததற்கு பார்வேர்ட் செய்திட முடியும்./: சர்ச் பாக்ஸில் உங்கள் கர்சரை நகர்த்த Shift+l : இமெயில் மெசேஜைப் படித்ததாக குறியீடு செய்வதற்குShift+u : இமெயில் மெசேஜைப் படிக்காததாகக் குறியிடr : மெயிலை அனுப்பியவருக்கு...
Tuesday, May 12, 2009
SQL SERVER – How to Drop Primary Key Contraint from a Table
First, we will create a table that has primary key. Next, we will drop the primary key successfully using the correct syntax of SQL Server.CREATE TABLE Table1(Col1 INT NOT NULL,Col2 VARCHAR(100)CONSTRAINT PK_Table1_Col1 PRIMARY KEY CLUSTERED (Col1 ASC))GOSecond, try to drop the primary key constraint using following lines./* For SQL Server/Oracle/MS ACCESS */ALTER TABLE Table1DROP CONSTRAINT PK_Table1_Col1GO/* For MySql */ALTER TABLE Table1DROP PRIMARY KEYGO Use the tips...
Thursday, April 23, 2009
Java Script : 'toFixed' Math function to format number
<div style="text-align: justify;">We can use 'toFixed()' function in math to format a number upto required decimal places. The value we get is after rounding the number upto the decimal place required. This function is frequently used in java script. </div>Here is the sample syntax. my_val.toFixed(4)my_val is the variable which stores the number. Here we are formatting the number upto 4 decimal places. Let us try with some examples with different number values. var my_val=11.257; document.write (my_val.toFixed(2)); // output 11.26...
Tuesday, March 31, 2009
Time Management
Time ManagementIn my profile, I mentioned as one of my strength is "Goal Setting". What is goal setting? We should plan our Day,Week & Month well before. As we plan we could achieve our goals. Just planning alone will not lead to complete our goals, we should implement it as per our plan. Time is most important here. If you plan half an hour for a job, you should try to finish it as you planned. First time it may not be possible, but when you practice it in your day today activities, it becomes your routine. After some time, you could finish...
Corporate Dress Code
Corporate Dress CodeCorporate dressing is a powerful tool in the office space. The manner in which you present yourself projects not only your personality but the image of the company too. Appropriate dress and grooming has a profound impact on co-workers as well as external customers.Dress Code Male:- Do’s1. Half /Full sleeve shirt with Tie2. Black/Brown Shoes - Dont’s1. Loud Design/Colour Shirts2. Sports ShoesDress Code Female: - Do’s1. Salvar /Saree’s2. Black/ Brown - Shoes / Chappal- Dont’s1. Tight Dresses and Sleeveless tops.2. Jeans...
Wednesday, March 25, 2009
WCF Performance: Making your service run 3 times faster
Wisely changing WCF defaults can yield a significant improvement in your service performance. The exact changes need to be made and their exact effect are dependent in the scenario. The example below how to speed up a certain service 3 times faster.Read more at http://webservices20.blogspot.com/2009/01/wcf-performance-gearing-up-your-service.Happy Codi...