Wednesday, September 29, 2010

How to write javascript in Code behind using C#

Many client-side tasks, such as tracking mouse events, setting page focus, displaying/hiding a section of page, was not directly supported by asp.net, this is happen because of server side operation. If we want to prevent the post-back and quickly we want to add or remove the content in the page we have to depend up on the JavaScript. So in asp.net using server code we can include the java script code by using Page.RegisterStartupScript

just include the following line to set the focus on the particular control during the time of page load.



I call the function where and when you want it. I call it at page load Event.

What happen when you create Web application

When SharePoint creates a Web application the following actions happening behind the scene:

Web Ste:
  • Creates a unique entry in SharePoint configuration DB for the Web App and assign GUID to that entry;
  • Create and configures a Web application in IIS;
  • Creates a root folder to store the Web application pages and associated resources;
  • Creates and configures an IIS application pool;
  • Configures authentication protocol and encryption settings;
  • Assign a Default alternate access mapping for the Web app;
  • Creates the first content database for the Web application;
  • Associate a search service with the Web application;
  • Assign a name to the Web application that appears in the Web application list in SharePoint Central Administration;
  • Assign general settings to the Web application, such as maximum file upload size and default time zone;

Site Collection:
  • Creates the top-level site based on a site definition;
  • Sets general properties for the site, such as the site title and site owner;

Priority Inbox in Gmail

By default once you configer your Priority Inbox it have three sections

1) Important – The mail that you configure as important will come under this section.

2) Startted – The mail that you marked as star are shown under this section

3) Everything Else – Other new mails and read mail will come under this section.

Two Basic steps to Configer Priority inbox

Step – 1

You will find “New Priority Inbox” next to our Email ID, as shown below.

Step-2

In this step by default it shows Important mail and Not Important mail, you can add or remove corresponding mail from corresponding section buy using ‘+’ or ‘-’ in the right hand side of the dialog box. Finally click the button ‘It Looks Right’.



That all now you will get the new Priority Inbox, in your account, and also you will find inbox link, you can switch back to both as you want. After configer Priority Inbox you will find the UI as below,



You will get new important mail to your Priority Inbox once you checked that mail it will come back to inbox, form there you will get it, from next time onwards.

Under Settings link, you can find Priority Inbox as below, you can costumize it as per your requirment.



Try to play arround this and enjoy this cool feature.

Source from: http://kethare.in

Sharepoint Cascading Drop Down

In sharepoint 2007 Custom List while adding new listitem, i want to populate the Customer Name in the dropdown based on the selection of Customer Category. The selection category column contain radio buttons, for each category.

Problem:

I have different lists,base on the selection of radio button i want to bind all the listitem from a particular list. Now the problem is how to access various List base on the selection. I tried it with work flow but it did not helped me, i decide to achieve using custom code, as it is in Newpage.aspx of the List, i have to deploy as custom web-part and i have to add functionality to it, that also not help me due to time constrain.

Solution:

After considering different type of solution i choose two option

1) Using javascript & CSS to hide the required control, (i.e) Based on my selection of the radio buttons field from the list will show up.

2) Develop custom Web part.

3) Using Cascading Drop Down instead of using radio button.

I feel using Javascript & CSS is not a good approch, so i decide to go with web-part at that time i got Cascading Drop Down article." Thanks to DataCogs."

CoolStuff

Source: http://kethare.in