Friday, August 5, 2011

funny

सावधान !!!!!
अगर   आप  बस  ट्रेन  प्लेन  या  कहीं  से  भी  आ  जा  रहे  हो  और  किसी  महिला /लड़की  के  हाथ  में फूल ,धागा ,चैन  या  चमकती  हुए  कोई  भी  वस्तु  देखें  तो  तुरंत  वहां  से  भाग  जाये .यह  वस्तु  राखी  हो  सकती  है . आपकी  ज़रा  सी  लापरवाही  आपको  भाई   बना  सकती  है .
पुरुष  हित   में  जारी  .....

Javacript image banner random rotator


Phew..enough conditions there ?

So, I needed this javascript image rotator which would pick files from a folder and show them randomely rotating through the images ...

Meh.. here is what I googled and searched and figured out 

First put a placeholder on the page...

 <div id="imageDiv">
                        <script language="javascript" type="text/javascript">
                            document.write('<center><img src="' + adBanner1 + '" id="adBanner5" width="620" height="250" border="0" alt="Some Alt Text">');
                            document.write('</center>');
                        </script>
                        <noscript>
                            <img src="/Images/rotate/1.jpg" id="adBanner5" border="0" width="620" height="250"
                                alt="Some ALt Text" /></noscript>
                        </div>



Now, getting a random number ...after all the first image should be random no ??

    <script language="JavaScript" type="text/javascript">
<!--
        rnd.today = new Date();
        rnd.seed = rnd.today.getTime();
        function rnd() {
            rnd.seed = (rnd.seed * 9301 + 49297) % 233280;
            return rnd.seed / (233280.0);
        };

        function rand(number) {
            var result = Math.ceil(rnd() * number);
            if (!result) result++;
            return result
        };
</script>

Now that we have a random number, lets populate the image 

<script language="javascript" type="text/javascript">
//the total number of images to rotate
                  var ad_cnt1 = 20;
        var ad1 = rand(ad_cnt1);
        var link1;
        var adBanner1;
        var width1
        var height1
        var i = 0;
        for (i = 0; i <= ad_cnt1; i++) {
            if (ad1 == i) {
                adBanner1 = "/images/rotate/" + i + ".jpg";
            }
        }                                   </script>



Now... using the rotator to rotate through the images
var currentAd5 = 1;
        function cycle5() {
            if (currentAd5 == ad_cnt1) {
                currentAd5 = 1;
            }
            var banner5 = document.getElementById('adBanner5');
            banner5.src = "/images/rotate/" + currentAd5 + ".jpg";
            currentAd5++;
        }
        window.setInterval("cycle5()", 5000);

Hmm so my final code would look like such:

In the head of the page I put this Javascript :

  <script language="JavaScript" type="text/javascript">
<!--
        function clearText(field) {

            if (field.defaultValue == field.value) field.value = '';

        }

        function restoreText(field) {

            if (field.value == '') field.value = field.defaultValue;

        }

        rnd.today = new Date();
        rnd.seed = rnd.today.getTime();
        function rnd() {
            rnd.seed = (rnd.seed * 9301 + 49297) % 233280;
            return rnd.seed / (233280.0);
        };

        function rand(number) {
            var result = Math.ceil(rnd() * number);
            if (!result) result++;
            return result
        };
        var ad_cnt1 = 20;
        var ad1 = rand(ad_cnt1);
        var link1;
        var adBanner1;
        var width1
        var height1
        var i = 0;
        for (i = 0; i <= ad_cnt1; i++) {
            if (ad1 == i) {
                adBanner1 = "/images/rotate/" + i + ".jpg";
            }
        }
        var currentAd5 = 1;
        function cycle5() {
            if (currentAd5 == ad_cnt1) {
                currentAd5 = 1;
            }
            var banner5 = document.getElementById('adBanner5');
            banner5.src = "/images/rotate/" + currentAd5 + ".jpg";
            currentAd5++;
        }
        window.setInterval("cycle5()", 5000);
-->
    </script>

And where I need to rotate the images I put this div 

  <div id="imageDiv">
                        <script language="javascript" type="text/javascript">
                            document.write('<center><img src="' + adBanner1 + '" id="adBanner5" width="620" height="250" border="0" alt="Some Alt Text">');
                            document.write('</center>');
                        </script>
                        <noscript>
                            <img src="/Images/rotate/1.jpg" id="adBanner5" border="0" width="620" height="250"
                                alt="Some Alt Text" /></noscript>
                        </div>



By the way "window.setInterval("cycle5()", 5000);" does the rotation at 5 sec interval... you can change it to suit your needs

And you are welcome



Friday, June 17, 2011

rang bikharenge toh fariyaad karegi khushboo
kisi phool ko chutki se machchal kar dekho

raat ko shamma ki maanind pighal kar dekho
zindagi kya hai kisi taap mai dhal kar dekho

Tuesday, May 24, 2011

just a thought

जिस दिन मंदिर की घंटी से स्वर मिल गया अज़ान का
उस दिन रूप बदल जायेगा अपने हिंदुस्तान का

Monday, May 16, 2011

Setting gridview edititemtemplate dropdownlist selectedvalue

This is a very quick way of setting the selectedvalue of dropdownlist in gridview edittemplate...

Just add the following to your dropdownlist

SelectedValue='<%# Bind("acceptance") %>' AppendDataBoundItems="true"


The entire column would look something like this




<asp:TemplateField HeaderText="Acceptance">

                <ItemTemplate>

                    <asp:Label ID="Acceptance" runat="Server" Text='<%# calcAcceptance((int) Eval("acceptance")) %>'  />

                </ItemTemplate>

                <EditItemTemplate>

                <asp:DropDownList ID="ddlAcceptance" runat="server"  SelectedValue='<%# Bind("acceptance") %>' AppendDataBoundItems="true">

                    <asp:ListItem Value="0">Acceptable</asp:ListItem> 

                    <asp:ListItem Value="1">Required</asp:ListItem> 

                </asp:DropDownList>

                </EditItemTemplate>

            </asp:TemplateField>




Wednesday, May 11, 2011

Posting Html code to blogger/blogspot

http://www.simplebits.com/cgi-bin/simplecode.pl

This is a simple but superb utility which lets you customize your html for posting to blogger !!!

Seal of approval from me...

I can be definitely not be the only person who thinks of a seal nodding approvingly every time they say seal of approval... am I ??

Placeholder dynamic controls

So, I had to build on what I started yesterday.

Now I have a spiffy code sample for all the times when I want to add dynamic controls to placeholders..

The sample below adds 5 rows to a table with all kinds of funky controls each having its own properties set separately....

Here it goes ....drumroll !!!!!!

Front End


 <table class="sofT" style="width: 100%">
        <tr>
            <td class="SubClass">
                Course #
            </td>
            <td class="SubClass">
                Course Title
            </td>
            <td class="SubClass">
                Hours
            </td>
            <td class="SubClass">
                Grade
            </td>
            <td class="SubClass">
                Grade Pt.
            </td>
        </tr>
 <tr>
            <td>
                <asp:Label ID="lblCrNo5" runat="server"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="tbCrNo5" runat="server" Width="300"></asp:TextBox>
            </td>
            <td>
                <asp:TextBox ID="tbHrs5" runat="server" Width="30" Text="0.00"></asp:TextBox>
            </td>
            <td>
                <asp:DropDownList ID="ddlHrs5" runat="server">
                </asp:DropDownList>
            </td>
            <td>
                <asp:TextBox ID="tbGPA5" runat="server" Width="30" Text="0.00" Enabled="false"></asp:TextBox>
            </td>
        </tr>
        <asp:PlaceHolder ID="plCols" runat="server"></asp:PlaceHolder>
    </table>
 <asp:Label ID="lblCounter" runat="server" Visible="false"></asp:Label>
  <hr />
          <asp:Button ID="btnAdd" runat="server" CssClass="btn" Text="Add More Classes"
                    onclick="btnAdd_Click" />



And in the backend 



  protected void Page_Load(object sender, EventArgs e)
    {
        if (Cache["tt"] != null)
        {
            Panel tt = Cache["tt"] as Panel;
            plCols.Controls.Add(tt);


        }
}


 protected void btnAdd_Click(object sender, EventArgs e)


    {
            Panel tt = new Panel();
     
        int courseCounter = Convert.ToInt32(lblCounter.Text);


//this is a fix needed else 5 gets repeated twice.... 
        if (courseCounter == 5)
            courseCounter = 6;


        int numlabels = courseCounter + 5;


//this is getting the data for dropdownlist 
        DataTable ddlTable = createDdlTable();


        for (; courseCounter < numlabels; courseCounter++)
        {


            DropDownList ddl = new DropDownList();


            // Set the label's Text and ID properties.
            ddl.DataSource = ddlTable;
            ddl.DataTextField =  "hrsToShow";
            ddl.DataValueField = "hrsToShow";
            ddl.ID = "ddlHrs" + courseCounter;
            ddl.DataBind();
           
            Label lbl = new Label();
            lbl.ID = "lblCrNo"+courseCounter;
            lbl.Text = courseCounter.ToString();


            TextBox tb = new TextBox();
            tb.ID="tbCrNo"+courseCounter;
            tb.Width= 300;


            TextBox tb1 = new TextBox();
            tb1.ID="tbHrs"+courseCounter;
            tb1.Width= 30;
            tb1.Text = "0.00";


            TextBox tb2 = new TextBox();
            tb2.ID="tbGPA"+courseCounter;
            tb2.Width= 30;
            tb2.Text = "0.00";
            tb2.Enabled=false;


      //I know all this can be single Add... divided it for clarity !!
            tt.Controls.Add(new LiteralControl(""));
            tt.Controls.Add(lbl);
            tt.Controls.Add(new LiteralControl(""));
            tt.Controls.Add(tb);
            tt.Controls.Add(new LiteralControl(""));
            tt.Controls.Add(tb1);
            tt.Controls.Add(new LiteralControl(""));
            tt.Controls.Add(ddl);
            tt.Controls.Add(new LiteralControl(""));
            tt.Controls.Add(tb2);
            tt.Controls.Add(new LiteralControl(""));
            plCols.Controls.Add(tt);
            Cache["tt"] = tt;
        }


        ddlTable.Dispose();
        lblCounter.Text = numlabels.ToString();
    }



And as Disney says ...THATS ALL,  FOLKS !!


Hope to add the processing of dynamic controls thus added to tomorrow's post

I dont miss you

ज़िदों ने तर्क-ऐ-तालुक कर लिया लेकिन
सुकून उसे भी नहीं, बेकरार मै भी हूँ
ज़बान कहती है सारा कसूर उसका था
ज़मीर कहता है कुछ ज़िम्मेदार मै भी हूं

Tuesday, May 10, 2011

How to retain all of the dynamically added asp controls


The asp.net doesn't keep control state.
So if you want to create control dynamically, you should create the dynamic control every time in Page_Load function.
You can store the dynamic control into cache, and then read it at page_load function.
Here is a example, maybe help you.
    protected void Button4_Click(object sender, EventArgs e)
    {
        Panel tt = new Panel();
        TextBox tb = new TextBox();
        tb.ID = "txtName";
        tb.Text = "hello";
        tt.Controls.Add(tb);
        PlaceHolder2.Controls.Add(tt);
        Cache["tt"] = tt;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Cache["tt"]!=null)
        {
            Panel tt = Cache["tt"] as Panel;
            PlaceHolder2.Controls.Add(tt);
        }
    }


Update only month and day of a date in SQL server

Well..sometimes Woopse happens...

We had begin dates and end dates in our database ....well somehow they got all wrong dates... years were correct and hence began the update process


Update TableName
Set End_Date =CONVERT(datetime, Convert(varchar(4),DATEPART(Year, End_Date))+'-05-01 00:00:00.000')
where (DATEPART(MONTH, End_Date)='05' and DATEPART(DAY, End_Date) != '01')

Spiffy !!!

Also, my running is going awesome... SO far so good 

Friday, May 6, 2011

100 days 20 pounds challenge

Ah.. am a usual average nerd who spends 10-15 hours each day on the computer, typing away to nothingness...and rejoicing in my daily intake of mountain dew, pizza and cheetos !!!

But all good things come to an end and my happy coding world crumbled down yesterday when one of my friends asked me if I was expecting a baby !!!

NO ..NO ...NO ..NO ...no no no ..NO ..NO ... and if I didn't make myself clear... OH HELL TO THE NO !!!

After that rude awakening, I have decided what I should have done long time ago. No more occasional saunterings to the gym..no more half hearted jogs... Am going 300 !! SPARTAAAAAAAAAAAAAAAAAAAAAA !!!!

I am going to run/workout every day for next 100 days ...Goal is to drop 20 pounds by the end of it.

20 pounds you say !! A very small goal !! Not for someone 5 feet 2 inches tall....

Its a ginormous task for mini me !!

And it all starts today...My plan is to workout every day and document my progress right here..

I was going to post before and after pictures but that would be too cliche.. NO ?

Let me think about that... meanwhile, 2 miles here I come  !!!

Wednesday, May 4, 2011

string format 2 decimal places

Sometimes, little things take longer than most big complicated humongous functions.

All I wanted to do was to create a datatable with formated 2 places of decimals and it wasnt working... for hours


private DataTable createDdlTable()
    {
        // Create a new DataTable.
        DataTable myDataTable = new DataTable("gpaTable");
        // Declare variables for DataColumn and DataRow objects.


        // Create new DataColumn, set DataType, ColumnName and add to DataTable.    
        DataColumn myDataColumn = new DataColumn();
        myDataColumn.DataType = Type.GetType("System.String");
        myDataColumn.ColumnName = "hrsToShow";
        myDataColumn.Unique = true;
        // Add the Column to the DataColumnCollection.
        myDataTable.Columns.Add(myDataColumn);




        // Instantiate the DataSet variable.
        DataSet myDataSet = new DataSet();
        // Add the new DataTable to the DataSet.
        myDataSet.Tables.Add(myDataTable);


        // Create three new DataRow objects and add them to the DataTable
        for (double i = 0.00; i <=9.50 ; i=i+0.50)
        {
            DataRow myDataRow = myDataTable.NewRow();
            myDataRow["hrsToShow"] = i.ToString("0.00");
            myDataTable.Rows.Add(myDataRow);
        }
        return myDataTable;
    }

Thursday, April 21, 2011

shayari

आपसे नहीं बिछड़े ज़िन्दगी से बिछड़े है 
हम चिराग अपनी रौशनी से बिछड़े है 
इस से बढ़ कर क्या होगा ताना मुकद्दर का 
जिस से भी मोहबत की हम उसी से बिछड़े है 

सितमगारो का है फरमान घर भी जाएगा 
अगर में झूट न बोला तो सर भी जायेगा 
बनाईये न किसी के लिए न ताज महल 
हुनर दिखाए तो दस्ते-इ-हुनर भी जायेगा 
माँ चलती है बच्चो के पाँव से जैसे 
उधर ही जाएगी बच्चा जिधर भी जायेगा

C# printing column names of datatable

Ah ..sometimes simple tasks baffle me...Here is a function to print column names of a datatable


private void PrintColumnNames(DataTable dt)
{
    // For each column, print the ColumnName.
        foreach(DataColumn column in dt.Columns)
        {
            Response.Write(column.ColumnName);
        }
}

Tuesday, April 19, 2011

C# file and directory operations

So, I was facing the task for displaying the directory and file contents for each directory and could not find any good help... anyways, here are the functions as I came up with them

Displaying all the directory names along with date last modified


    private string displayDirectories( DirectoryInfo parentDirectory )
    {
        DirectoryInfo[] diArrGE = parentDirectory.GetDirectories();
        // Response.Write(parentDirectory.Name + "

");
        String link = "
";
        foreach (DirectoryInfo dri in diArrGE)
            {
            Int32 index = dri.Name.IndexOf('_');
            String dirName = dri.Name.Substring(index).Replace("_", " ");
            link += string.Format("
", category, dri.Name, dirName, dri.LastWriteTime.ToLongDateString());
            }
        link += "
{2} (Last updated: {3})
";
     
        return link;
        }



Displaying all the files in a directory sorted by date modified... 



    private string displayFiles( DirectoryInfo di )
        {
        string link = string.Empty;
         StringBuilder test = new StringBuilder();
//I just need html files in the directory
        FileInfo[] rgFiles = di.GetFiles("*.html");


        try
            {
            string category = "";
            if (di.FullName.Contains("Agenda"))
                {
                category = "Agenda";

                }
            else if (di.FullName.Contains("Minutes"))
                {
                category = "Minutes";
                }
            else
            {
                category = "Panel";
            }

            // Now read the creation time for each file
            DateTime[] creationTimes = new DateTime[rgFiles.Length];
            for (int i = 0; i < rgFiles.Length; i++)
                creationTimes[i] = rgFiles[i].LastWriteTime;
         //   Response.Write(creationTimes.Length);
            // sort it
            Array.Sort(creationTimes, rgFiles);

            foreach (FileInfo fi in rgFiles)
                {

           
                string[] result = fi.Name.Split(new Char[] { '.' });


                string[] fileName = result[0].Split('_');

                string fileNameDisplay = string.Format("{0} {1},{2}", fileName[1], fileName[0], fileName[2]);

                //  Response.Write(fileNameDisplay);


                link = "" + fileNameDisplay + "   {Last Update: " +
                               fi.LastWriteTime.ToString("D") + "}";

                test.Insert(0, link);
                }
            //link = "";
                test.Insert(0, "
");
            test.Append("
");
            }
        catch (Exception e)
            {

            Response.Write("Error in file " + e);
            }
        return test.ToString();
        }

I really liked the sorting function

       // Now read the creation time for each file
            DateTime[] creationTimes = new DateTime[rgFiles.Length];
            for (int i = 0; i < rgFiles.Length; i++)
                creationTimes[i] = rgFiles[i].LastWriteTime;
         //   Response.Write(creationTimes.Length);
            // sort it
            Array.Sort(creationTimes, rgFiles);


WOO WOO for that

Tuesday, March 29, 2011

Malformed container error in IMail server

Ah... symantec decided to start marking random emails sent through ipswitch as virus...and i was alarmed..

This was the solution on IPSwitch site

This happens when something in the message did not conform to one of the RFC's for MIME Encoding. These RFC's are 2045-2049. This is usually caused by a mail client that is improperly formatting the message. There are two options to remedy the issue. You can disable the "Malformed Container Processing" or determine a way to compose the message in a way that formats the message properly. This may mean using a different client or contacting the mail client vendor.
To disable Malformed Container Processing, follow the steps below:
1.) On the server, open https://localhost:8004  in a browser.
2.) Log in with the password created during installation, otherwise click in the password field and press the enter key.
3.) Click on the "Policies" icon on the left.
4.) Click "Filtering" located in the margin.
5.) Click on the "Container Handling" tab.
6.) In the "Malformed Container File Processing" section, uncheck the "Block malformed containers."
7.) Click Apply icon, (brown arrow, second icon in upper left corner).

But the world is not that eazy... the JRE refused to run the applet needed for antivirus interfacel...
load: class com.symantec.gui.guidelines.ScanEngineApplet not found.
java.lang.ClassNotFoundException: com.symantec.gui.guidelines.ScanEngineApplet
        at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://:8004/com/symantec/gui/guidelines/ScanEngineApplet.class
        at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
        at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
        at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        ... 7 more
Exception: java.lang.ClassNotFoundException: com.symantec.gui.guidelines.ScanEngineApplet
I went to Symentec site and looked around
They said the following
The problem is on client side.  
Remove 1.6.0_12 Jre.  It can only run with 1.5.0 JRE. 
If you have both 1.6 and 1.5 installed, then browser will use 1.6 causing you problem.
I had the same issue but solved.  Symantec has the solution listed here.
http://service1.symantec.com/support/ent-gate.nsf/docid/2008092215494254

So, I went to Java site next and they said to do the following to remove "older versions"

Windows 7 and Vista - Uninstall Programs
  1. Click Start
  2. Select Control Panel
  3. Select Programs
  4. Click Programs and Features
  5. Select the program you want to uninstall by clicking on it, and then click the Uninstall button.
You may need administrator privileges to remove programs.
Windows XP - Uninstall Programs
  1. Click Start
  2. Select Control Panel
  3. Click the Add/Remove Programs control panel icon
  4. The Add/Remove control panel displays a list of software on your system, including any Java software products that are on your computer. Select any that you want to uninstall by clicking on it, and then click the Remove button.
Am just a lowly sys admin not about to challenge the mighty java folk...So, I did as they commanded and removed JRE 1.6.0_12 from my machine and VOILA... I was able to follow the IPswitch's initial instructions to the word... 

Ah sometimes you really do have to step back to step forward....

Monday, March 28, 2011

Viewstates in C#

So, as is inevitable with any .NET admin.. (pseudo admin in my case)... I ran headfirst into a fight with the viewstates...

Between the various view state errors... I looked online and found this


 What does the EnableViewStateMac setting in an aspx page do?
Setting EnableViewStateMac=true is a security measure that allows ASP.NET to ensure that the viewstate for a page has not been tampered with. If on Postback, the ASP.NET framework detects that there has been a change in the value of viewstate that was sent to the browser, it raises an error - Validation of viewstate MAC failed.
Use <%@ Page EnableViewStateMac="true"%> to set it to true (the default value, if this attribute is not specified is also true) in an aspx page.

I also highly recommend reading this article


It is very precise explanation of the devil that is viewstate

Wednesday, March 23, 2011

Comparing dates in C#


DateTime date1 = new DateTime(2009, 8, 1, 0, 0, 0);
DateTime date2 = new DateTime(2009, 8, 1, 12, 0, 0);
int result = DateTime.Compare(date1, date2);
string relationship;

if (result < 0)
   relationship = "is earlier than";
else if (result == 0)
   relationship = "is the same time as";         
else
   relationship = "is later than";

Response.Write(string.format("{0} {1} {2}", date1, relationship, date2));


 The example displays the following output:
//    8/1/2009 12:00:00 AM is earlier than 8/1/2009 12:00:00 PM

Tuesday, March 22, 2011

Session ticker with Javascript and C#

So, I built the awesomest application in the world and was stumped by a simple conundrum..

The users didnt realize they were getting timed out

So I found this gem... and modified it to be added to the master page


  var sessionTimeout = "<%= Session.Timeout %>";
  
        function DisplaySessionTimeout()
        {

            var sessionValue = '<%= Session["userID"] %>';
            //assigning minutes left to session timeout to Label
            if ((sessionValue != "")&&(sessionTimeout > 0)) {

                document.getElementById("<%= lblSessionTime.ClientID %>").innerText =
                                                                       "Session time left: " + sessionTimeout + " minutes";
                sessionTimeout = sessionTimeout - 1;

                //if session is not less than 0

                //call the function again after 1 minute delay
                window.setTimeout("DisplaySessionTimeout()", 60000);
            }
//            else {
//                //show message box
//                alert("Your current Session is over.");
//            }
        }




after adding this to the head.. I added this label to the body

    
        < asp: Label ID ="lblSessionTime" CssClass="showGreen" runat="server" >

and VOILA !! there is a green ticker updating every min informing people of the impending doom.. I mean session timeout

AH HAAA




Monday, February 14, 2011

Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


So.. I decided to play around with AJAX...just because I run 2 years behind everyone else in the world... anyways.. the very first compile, I get this error...


Server Error in '/Ajax' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 30:    
Line 31:      
Line 32:        
Line 33:      
Line 34:    

Source File: ***\Visual Studio 2010\Projects\Ajax\web.config    Line: 32

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


=== Pre-bind state information ===
LOG: User = ***
LOG: DisplayName = System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///***/Visual Studio 2010/Projects/Ajax/
LOG: Initial PrivatePath = ***\Visual Studio 2010\Projects\Ajax\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: ***\Visual Studio 2010\Projects\Ajax\web.config
LOG: Using machine configuration file from ***\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///***/Temporary ASP.NET Files/ajax/10e788b7/30cb6ce9/System.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///***/Temporary ASP.NET Files/ajax/10e788b7/30cb6ce9/System.Web.Extensions/System.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///***/Visual Studio 2010/Projects/Ajax/bin/System.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///***/Visual Studio 2010/Projects/Ajax/bin/System.Web.Extensions/System.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///***/Temporary ASP.NET Files/ajax/10e788b7/30cb6ce9/System.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///***/Temporary ASP.NET Files/ajax/10e788b7/30cb6ce9/System.Web.Extensions/System.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///***/Visual Studio 2010/Projects/Ajax/bin/System.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///***/Visual Studio 2010/Projects/Ajax/bin/System.Web.Extensions/System.Web.Extensions.EXE.

And began the painful process of debugging and screaming and kicking...

DOH !!

I did not install the AJAX extension

I need to install ASP.NET 2.0 AJAX Extensions 1.0

Once I did that... all was well in my world once more...