Silverlight Toolkit October 2009 Released

I am glad to announce that my favorite Silverlight Toolkit has a next release out for production use earlier release was in July 2009 and now its the October Release. You can download this release at http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30514#DownloadId=88327 Change List includes

Visual Studio 2010 Support
  • All controls updated to provide a great design time experience in Visual Studio 2010
Charting
  • All classes now unsealed
  • ISeries interface introduced as base interface for all Series
  • Breaking change: StylePalette renamed Palette and type changed to IEnumerable<ResourceDictionary> from IEnumerable<Style>
  • LegendItemStyle introduced to provide easier customization of LegendItem
Drag & Drop
  • Drag & drop support added for common items controls such as ListBox, TreeView, DataGrid, and charting controls.
  • System.Windows.Controls.Data.Toolkit assembly added.
  • The System.Reactive assembly is now installed alongside other Silverlight Toolkit binaries.

Other Updates

Accordion
  • Themes updated to add support for this control
ChildWindow
  • Themes updated to add support for this control
DataForm
  • Themes updated to add support for this control
DataPager
  • Themes updated to add support for this control
DomainUpDown
  • Mouse wheel support added to change value
GlobalCalendar
  • Mouse wheel support added to navigate between months in year mode and years in decade mode
GridSplitter
  • Themes updated to add support for this control
TimePicker / TimeUpDown
  • Mouse wheel support added
TreeMap
  • VB Sample added

System.IO.FileNotFoundException Could not load file or assembly 'App_Web, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified

I recently faced this problem with one of my WCF services, i was unable to find the reason for this as it complains that it could not load an assembly which in my case never existed.So seeing the error i knew that it was not my fault but it was the fault of the framework itself. What i know and what seemed to me is that this error occurs due to some invalid data in the temporary files which .net creates while running an application.Due to the differences in the code of the temporary files from the actual code this error arises. Little help from Google suggested me that it’s a known issue and Microsoft has not yet found any fix for this situation although there are a few workarounds which you can do in order to escape from this problem. In this article i will discuss those workarounds and remember there is no specific workaround so you have to test all whichever may suite you.

  • First of all just try this one and see if it works then its the easiest, just make a note of whichever control is causing trouble to you it could be your masterpage, you usercontrol or your web service or WCF service.Just go to that control or service and simply edit something, just deleting a small space or pressing an enter key and deleting some white spaces would do and save the document, what this will do is it will ask the runtime to regenerate the temporary file and the regenerated temporary file will be correct as earlier somehow the temporary file generated for this file was incorrect.So most of the times this would do the trick especially in case of services.
  • If the first solution doesn’t help you then you can go to c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files and delete all the files and force a complete recompile of the whole application.You have to be very careful in deleting the temporary files and don’t try this on the production server this tip is for those who know about the working of .net.If some files are locked then you can unlock them using “Unlocker
  • If the above 2 steps don’t work for you then add the batch= “false” compilation tag in your web.config

I think these three steps are sufficient to overcome this problem. Moreover one thing which i want to add is that never directly start updating your production website with the new updates by just copying the new files on the production server, before copying just take the website down i.e pause the website and once your are done with your changes again put the website to go live or else you will run into this trouble every now and then. If you have faced similar problems and you found some other solution or cause to this problem you can just share it here with smallworkarounds readers to help the community. Happy Programming!!!!!!!!!!!!!!!!!!


Customizing Asp.net menu control to use jQuery,Superfish and CSS Friendly Control Adapters

I have used Asp.net menu controls in a lot of applications earlier but now a days with so many new things and controls asp.net menu control seems to lag in many basic functionalities, there are various other options available to be used as a replacement of the asp.net menu control. But what i loved with the asp.net menu control was its seamless integration with the sitemap datasource and with no hassle i could display whole of my site’s navigation in the menu control by just configuring them in the sitemap file. What i disliked most was that the menu control by default is rendered as a table structure and not as div structure. So to fight this abnormality Microsoft released CSS Friendly Control Adapters so that most of the controls which are rendered as tables can be rendered as a simple and clean div structure. But today i was experimenting with other available options and i found a really cool Superfish jQuery plug-in which we can attach with the asp.net menu control to achieve very cool affects. In this article i will share the steps on how to hook up the Superfish jQuery Menu plug-in into your asp.net website to beautify your asp.net menu control. Also please check various option available with the Superfish plug-in on how it can be customized from the Superfish plug-in website. http://users.tpg.com.au/j_birch/plugins/superfish/#examples Now let’s look at the steps to integrate superfish menu with asp.net menu

Main JavaScript file which is required is superfish.js along with jQuery any version.js rest files are optional and are used if we use some advanced features and customizations with the superfish menu. Main CSS file is superfish.css and for this demo we will modify this file only.

  • After downloading the superfish menu files now we should download the CSS Friendly Adapter from http://cssfriendly.codeplex.com/
  • Place the CSSFriendly.dll into your website bin folder and the CSSFriendlyAdapters.browser in your App_Browser folder.Also remember to comment out the unwanted code from the CSSFriendlyAdapters.browser file as we are dealing only with the menu.
 <controlAdapters>
      <adapter controlType="System.Web.UI.WebControls.Menu"
               adapterType="CSSFriendly.MenuAdapter" />
      <!--adapter controlType="System.Web.UI.WebControls.TreeView"
               adapterType="CSSFriendly.TreeViewAdapter" />
      <adapter controlType="System.Web.UI.WebControls.DetailsView"
               adapterType="CSSFriendly.DetailsViewAdapter" />
      <adapter controlType="System.Web.UI.WebControls.FormView"
               adapterType="CSSFriendly.FormViewAdapter" />
      <adapter controlType="System.Web.UI.WebControls.DataList"
               adapterType="CSSFriendly.DataListAdapter" />
      <adapter controlType="System.Web.UI.WebControls.GridView"
               adapterType="CSSFriendly.GridViewAdapter" />
      <adapter controlType="System.Web.UI.WebControls.ChangePassword"
               adapterType="CSSFriendly.ChangePasswordAdapter" />
      <adapter controlType="System.Web.UI.WebControls.Login"
               adapterType="CSSFriendly.LoginAdapter" />
      <adapter controlType="System.Web.UI.WebControls.LoginStatus"
               adapterType="CSSFriendly.LoginStatusAdapter" />
      <adapter controlType="System.Web.UI.WebControls.CreateUserWizard"
               adapterType="CSSFriendly.CreateUserWizardAdapter" />
      <adapter controlType="System.Web.UI.WebControls.PasswordRecovery"
               adapterType="CSSFriendly.PasswordRecoveryAdapter" /-->
    </controlAdapters>

 

  • Also download the latest version of jQuery, otherwise there is already a version of jQuery in the Superfish package.
  • Now start creating your pages and once you are done , just create a sitemap file to list your whole website.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="" title=""  description="">
        <siteMapNode url="Default.aspx" title="Home" description=""/>
        <siteMapNode url="AboutUs.aspx" title="About Us"  description="" />
        <siteMapNode url="Services.aspx" title="Services"  description="" >
            <siteMapNode url="Services/Service1.aspx" title="Service1" description="">
                <siteMapNode url="Services/SubService1.aspx" title="SubService1" description="" />
                <siteMapNode url="Services/SubService2.aspx" title="SubService2" description="" />
                <siteMapNode url="Services/SubService3.aspx" title="SubService3" description="" />
                <siteMapNode url="Services/SubService4.aspx" title="SubService4" description="" />
            </siteMapNode>
            <siteMapNode url="Services/Service2.aspx" title="Service2" description=""/>
            <siteMapNode url="Services/Service3.aspx" title="Service3" description=""/>
            <siteMapNode url="Services/Service4.aspx" title="Service4" description=""/>
        </siteMapNode>
        <siteMapNode url="ContactUs.aspx" title="Contact Us" description=""/>
    </siteMapNode>
</siteMap>
  • After building all this your solution architecture should be like this.

  • Now just the master page configuration is left and you are ready to go then
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Default.master.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script src="Scripts/jquery-1.3.1.js" type="text/javascript"></script>

    <script type="text/javascript" src="Scripts/superfish.js"></script>

    <link type="text/css" href="~/Styles/superfish.css" rel="stylesheet" media="screen"
        runat="server" />
    <link href="Styles/stylemain.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        $(document).ready(function() {
            $('ul.AspNet-Menu').superfish();
        }); 
    </script>

    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div id="outerWrapper">
        <div id="header">
            <div id="logo">
                <asp:HyperLink runat="server" NavigateUrl="~/Default.aspx" ID="lnkLogo">    
                </asp:HyperLink>
            </div>
        </div>
        <div id="menu">
            <asp:Menu ID="menuMain" runat="server" DataSourceID="stmpDataSource" Orientation="Horizontal">
            </asp:Menu>
            <asp:SiteMapDataSource ID="stmpDataSource" runat="server" ShowStartingNode="false" />
        </div>
        <div id="mainContent">
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
        </div>
        <div id="footer">
        </div>
    </div>
    </form>
</body>
</html>
  • Important :- By default the Superfish menu css file contains the settings aligned with the ul name sf-menu but the asp.net menu control renders the ul element as AspNet-menu so the important step is to replace all the occurrences of sf-menu in the superfish.css with AspNet-menu to make this menu work.

You can download the sample project and plug and play with the CSS file customized for the asp.net menu if you find difficulties in customizing by your self.

After embedding this in your master page you are done with the settings and customization and you are ready to go, i got this menu in just 15 minutes so simple and so easy.

Working Demo can be seen here https://www.smallworkarounds.com/demos/superfish.demo/

Download the Demo from https://www.smallworkarounds.com/blog/democode/Superfish/Superfish.Demo.zip

Happy Programming!!!!!!!!!!!!!!!!!!!!


Microsoft supporting web startups and independent web developers by providing free software's for 3years

Microsoft has launched today a very exciting program called WebSiteSpark for individual developers and small web startup companies having less than 10 employees. Given below are few software licenses which will be given free to you for 3 years

  • 3 licenses of Visual Studio 2008 Professional Edition
  • 1 license of Expression Studio 3 (which includes Expression Blend, Sketchflow, and Web)
  • 2 licenses of Expression Web 3
  • 4 processor licenses of Windows Web Server 2008 R2
  • 4 processor licenses of SQL Server 2008 Web Edition
  • DotNetPanel control panel (enabling easy remote/hosted management of your servers)

IMHO it is very good initiative by Microsoft to promote small companies and individuals to leverage their products and build next generation application on the web. More information can be found here http://weblogs.asp.net/scottgu/archive/2009/09/24/announcing-the-websitespark-program.aspx http://www.microsoft.com/web/WebSiteSpark


Saving Changes is not permitted.The changes you have made require the following tables to be dropped and recreated..Sql Server 2008 Management Studio Express Error

If you have just installed Sql Server 2008 Express Edition and you have your default settings then you probably might get this error when your want to change some table and then save changes. In the default settings “Prevent Saving changes that require table recreation” is checked which prevents to save the changes which you make in the design of the table. So in this article i will talk less and give you a walkthrough on how to remove this ugly error and to keep it explanatory i will use images rather then simple text. So the error looks like this   Now the stepwise solution is :-

  1. Click Cancel on this screen and then click OK on the next screen.
  2. On the top menu bar select the Tools option and inside tools select the Options menuitem.

    3.Inside options select the “Designer” and in the designer context form “uncheck” the option which says “Prevent Saving changes which requires recreation”.   4.Click OK and you are done and now save changes to your table and your error should no vanish. Happy Programming!!!!!!!!!!!!


Unable to connect to Sql Server 2008 Express Edition Remotely using the IP and the named instance

If you are trying to connect your sql server 2008 express edition instance remotely and facing problems while connecting it although you have tried all the possible solutions in the book then the problem can be a really very silly thing and what’s that thing , i will describe it shortly. If you are getting the below mentioned error then there might be many reasons for that error. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (.Net SqlClient Data Provider) So in the list of probable reasons is :-

  • Check if the sql server 2008 express edition service and sql server browser services are running or not, if not then please run them first.

  • First check whether TCP/IP is enabled in the Sql Server Configuration Manager Tool and select the instance of sql server 2008 express edition for that, if not enabled enable it.

  • If TCP/IP is enabled then check your firewall settings open two ports 1433 and 1434 on the firewall, generally 1433 is meant for Sql server and 1434 is meant for sql server browser. 1433 is TCP port and 1434 is UDP port
  • The silly mistake which happens when working with sql server 2008 express edition is that by default it runs on dynamic ports so you can’t run it remotely with all the above configuration and it will lead to frustration.So what to do then, the solution is just go to properties of the TCP/IP and in the TCP Port just give whatever port you want your sql server to be run on.That will do the trick for you.

 

  • After doing the port settings now check the firewall rules and open the respective ports which you have just configured and your sql server instance will run remotely.

Happy Programming!!!!!!!!!!!!!!!!!!!!


Adding Google Friend Connect to Blogengine.net Blog

Today i am shifting my blog from BlogSpot to custom domain, so i will be doing a series of post in all the hassles i have to face during this exercise and share my experience with you, so that any one else in plans of shifting the blog to custom domain and also the blog code being open source, should not face the same problems as i am facing. Smallworkarounds was known for its unique look and feel and various plugins customized in the heart of Google’s blogger.Still the new blog is not even close to the look and feel of the current BlogSpot version but its OK for now i will be rewriting the whole code myself within few days as i get time from my busy schedule. I will be writing mostly on how to transfer each module you see on Smallworkarounds on blogspot to www.smallworkarounds.com. For today i will be discussing how to integrate Google’s Friend Connect into BlogEngine.net. First of all let me tell you why i chose blogengine.net, the obvious reason is that i have already worked on blogengine.net and i am familier with most of its code and I can do tweaks to it’s code in no time. Secondly what i found after googling was that blogengine.net is the leader in the open source blog engines built in .net. Although there are few other competitors but again all comes to personal choice you can use anyone of the other products out there. I faced few issues with blogengine.net on Godaddy but i will be dealing those issues in the upcoming posts. So let’s begin the journey from what i am currently doing and leave the  rest for future. Currently i have all my posts imported from blogger to blogengine.net  with some minor errors which i am tweaking daily. In my blogspot blog i was having a Google Friend Connect toolbar which used to pop up at the bottom, but now the question is how to get the same popup bar with same followers in your blogengine.net blog with your custom domain. Googling a bit lead me to this post by Mayank Raichura , he has done all the hard work but what he has implemented is a little different from what i wanted. You can download his sample from here Hi implementation lets you to have google friend connect only inside the posts pages not on all the pages as this is clear from his code i modified his code a bit and everything then worked just fine for me.

 public void CreateFriendConnectBar(ServingEventArgs e)
    {
        settings = ExtensionManager.GetSettings(GetType().Name);

        //Settings should be retrieved after this...
        string sb_Site_ID = settings.GetSingleValue("Site_ID").ToLower();
        string sb_Div_Tag_ID = settings.GetSingleValue("Div_Tag_ID").ToLower();
        string sb_Scope_of_Social_Bar = "SITE";        
        bool sb_Allow_Anonymous_Post = bool.Parse(settings.GetSingleValue("Allow_Anonymous_Post").ToLower());

        //End Settings Retrieval
        e.Body += "n<!-- Google_Friend_Connects_Social_Bar extension by Mayank Raichura -->n";
        e.Body += BuildHTML(sb_Site_ID, sb_Div_Tag_ID, sb_Scope_of_Social_Bar, sb_Allow_Anonymous_Post);
    }
    private void Post_Serving(object sender, ServingEventArgs e)
    {
        post = (Post)sender;
        CreateFriendConnectBar(e);
    }

I removed his code where he is checking whether it is a post page or stuffs related to posts which he is checking in his first few lines and created a method called CreateFriendConnectBar(ServingEventArgs e) which i call from the Post_Serving event basically i am not checking that is the post null or something else, this will run in every case.

The important thing which you have to do other then what is stated is instead of this line

string sb_Scope_of_Social_Bar = "PAGE";

 

just replace “PAGE” with “SITE”, then just follow the instruction given on his blog to complete the steps.

string sb_Scope_of_Social_Bar = "SITE";

 

One more thing which most of you will forget is that consider a situation wherein from your previous blogspot blog your were having 2000 followers then you definitely would not want to lose your followers by just going and creating a absolutely new account for the new domain hosting.

So the solution for this is just go to your Google Friend Connect account and remap the url or site url field to your new website on the custom domain.

 

 

 

Also as a quick tip make sure your are having rpc_relay  and canvas files in your website root folder.


Text not scaling properly during animation in Silverlight

If you are facing the problem where you text is not scaling properly and the animation is not coming smooth then in this kind of situation you have to use something which can find the nearest neighbor and convert the values in accordance with this nearest neighbor. If you are using Silverlight then you can do this very easily by typing just one line of code. For Silverlight 2 you have to type RenderOptions.TextRenderingMode = “RenderForAnimation” For Silverlight 3 you have to type TextOptions.TextHintingMode = "Animation" Both of these ensure that the text animation is proper, if you don’t use these properties then you will find sometime when you are applying some scaling or any other rendering transformation on any container which also contains some text element then this text element inside the container will also scale. I will give main emphasis on Silverlight 3 property i.e TextOptions.TextHintingMode This property takes one of two possible values: Animated or Fixed. “Animated optimizes for animation by using a more efficient, but less visually precise, smoothing algorithm. Text is still readable and the loss of precision is not that severe.” Fixed uses an algorithm that is optimized for visually precise text smoothing, but can lead to performance issues. For example, when animations are applied to properties of a text element, in particular FontSize, you might see jitters. When transforms, positioning, or projections are applied to text elements, you might see performance issues. Fixed is the default. You can apply this property to a layout container and the setting will apply to any text element within that container. However, in general, you should apply this property directly to a text element, such as a TextBlock, TextBox, or Glyphs, where the animations applied will only affect the text. Happy Programming!!!!!!!!!!!!!!!


Deleting User Alerts in Sharepoint (MOSS 2007)

Setting alerts in MOSS 2007 is very easy just go to any list or library right click on Actions Tab and the last option available is the Alert Me feature. Configuring these alerts is very simple and is a child’s play but customizing the alert emails which are sent and sending list specific email alerts and stuffs like this are little bit tricky. Don’t worry here we are not discussing those horrifying issues but here we are simply going to discuss on how to delete the alerts which user has set on a particular list. There is a very simple process to do this you don’t need to write code for that but i am sharing this with you as for the novice programmer it’s a tedious task to find actually where to go to delete these alerts.

  • Just go to “Site Actions” on the top right corner of your sharepoint site and then click “Site Settings”.

 

  • Now look for the Site Administration section under that look for the User Alerts.

  • Once the User Alerts page is opened select a user for which you want to delete the alert, as you select the username from the dropdown list then all the alerts related to that user will be displayed.
  • Now you can select single or multiple alerts and click on the “Delete Selected Alert” link to delete the selected alert.

Stay tuned for more articles on Sharepoint (MOSS 2007) Happy Programming!!!!!!!!!!!!!!!!!!!


Finding and changing the default timer interval for timer jobs in Sharepoint

Many times we need to change the default timer settings either by increasing the default time or by decreasing the default time of the timer jobs for a particular sharepoint site. Particularly if you want to send an email as soon as an action is performed within the sharepoint, in such a scenario you will need to decrease the default timing of the timer job. There are two commands by which you can achieve this very easily:-

  1. Finding the default time of the timer job, the delay in sending mails could be due to the default timing of the timer jobs which is by default 5 minutes.
  2. Decreasing the default time of the timer job to 1 minute.

That’s all you need to do to adjust the default timer job timing delays. Happy Programming!!!!!!!!!!!!!!!!!