Oct 30

As some of you may have already heard, Enterprise Library 4.1 was released by the Patterns & Practices group at Microsoft. I used to implement application blocks from Enterprise Library’s previous versions in my previous projects. So I decided to take a quick look for personal update.

Installing this version of Enterprise Library is much better than previous installations, as this one gives you the choice to extract AND build the different application blocks at the same time, instead of using a different installer to extract and build the source codes.  The change log for this release is available here (highly recommended to read).  If you’re looking to upgrade your skills with Enterprise Library, I strongly suggest the Hands On Labs and the Getting Started tutorials for each of the application blocks. 

For more information about Enterprise Library (resources, tutorials, news, etc.) I strongly recommend you referring to these sites:
Pieter's Blog on Enterprise Development
Tom Hollander's blog
Patterns And Practices Guidance

Aug 06

As you see on the right side I’ve many widgets and planning to add some more. But I think having so many widgets, especially if they are tall, is not visually so nice and effective. I searched for anyone who had the same problem and found Chris’s blog and his a brilliant solution,  Collapsible Widgets”.

The idea is really nice but on the other hand, setting the display style directly to none or block causes sharp and graceless transition. Hence there are many js codes for animated div transitions; I decided to go for another solution to collapse/expand the widgets with animation. After a quick search I found a handy animation on DynamicDrive.

The rest of work is just to place these js files correctly into BlogEngine and configure it. To do this, fist; add these two js files into js folder (create a new folder named as js in the webroot ) in your webapplication’s root.


Then we need to add these js files into the generated pages on runtime. BlogEngine has a nice page structure and so easy to add js files with the
AddJavaScriptInclude function in BlogEngine.Core/ Web /Controls/ BlogBasePage.cs file. Add the following lines to the BlogBasePage.cs in line 89.

 

   1:  //add JS files for animatedPanel
   2:  AddJavaScriptInclude(Utils.RelativeWebRoot + "js/jquery-1.2.2.pack.js");
   3:  AddJavaScriptInclude(Utils.RelativeWebRoot + "js/animatedcollapse.js");
   4:   
   5:  //and the original code goes on
   6:  AddJavaScriptInclude(Utils.RelativeWebRoot + "blog.js");
   7:  if (User.IsInRole(BlogSettings.Instance.AdministratorRole))


Then, we need to configure widgets to toggle theirselfs to collapse/expand. Editing App_Code/ Controls/ WidgetBase.cs as following will be enough to complate our changes.

 

   1:  if (ShowTitle)
   2:     //Change the title text to an active link to toggle collapse/expand toggle
   3:     sb.Append("<a href=\"javascript:animatedcollapse.toggle('widgetContent" + WidgetID + "')\"><h4>" + Title + "</h4></a>");
   4:          
   5:     //old title
   6:     //sb.Append("<h4>" + Title + "</h4>");
   7:  else
   8:     sb.Append("<br />");
   9:   
  10:     //Change the contentDiv and give the id starts with widgetContent
  11:     sb.Append("<div  id=\"widgetContent" + WidgetID + "\" class=\"content\">");
  12:   
  13:  writer.Write(sb.ToString());
  14:  base.Render(writer);
  15:  writer.Write("</div>");
  16:  writer.Write("</div>");
  17:   
  18:  //Initialize animatedcollapsepanel for widget.
  19:  writer.Write("<script type=\"text/javascript\"> animatedcollapse.addDiv('widgetContent" + WidgetID + "', 'fade=1'); animatedcollapse.init();</script>");


That’s all, you can see the result on my widgets by clicking their titles.

I think having smooth UI transitions and animated stuff in your webpage is not bad :)


Download the codes
: AnimatedWidgets-BlogEngine.NET.rar (21.97 kb) 

kick it on DotNetKicks.com
 

Aug 05
A while ago I was working on Web Parts and their personalization futures so I worked with custom editors and editor zone. As you know, editor zone is displayed at a fixed location. But for users it is really handy to have editor zone on top of the each corresponding webpart, please check your igoogle page and try to edit one of the widgets. You will see what I mean.  

So at the beginning I searched for injecting editor zone into webpart. But after really complicated and dirty code, it didn’t work efficient. Later on I made a little investigation on rendered HTML page with IE Developer Toolbar. I found out that every webpart has a table identified as “WebPart_” + WebPartID. So if we have an HTML table than it is a piece of cake to inject a div (editor zone) into it with javascript.  

Here is the javascript that positions the editor zone on the selected webpart.

<script language="javascript" type="text/javascript">
          function PositionEditor(part) {
                if (document.getElementById('EditorZone2') != null) {
                       
var tr = document.getElementById('WebPart_' + part).insertRow(1);
                        var td = tr.insertCell();
                        td.appendChild(document.getElementById(
'EditorZone2'));
                      }
          }
</script> 
 

And for sure, we need to register that function call on the page render as fallows: 

protected void Page_Prerender(object sender, EventArgs e)
{
    
if (WebPartManager1.SelectedWebPart != null)
            
ScriptManager.RegisterStartupScript(this, typeof(Page), Guid.NewGuid().ToString(), "PositionEditor('" + WebPartManager1.SelectedWebPart.ID + "');", true);
}


That’s it.


kick it on DotNetKicks.com
Tags: | |
Dec 12

The preview version of ASP.NET 3.5 Extensions is released. The Extensions are a new set of tools and controls that will be added onto existing release of ASP.NET with .NET 3.5. This will make possible for web developers to get the latest updates on ASP.NET without having to wait 1-2 years more for the next release of .NET Framework.
It also includes ADO.NET Entity Framework Beta 3, which you can also download as a separate file here (you do not need to download it if you have ASP.NET 3.5 Extensions Preview installed already).


What’s in the Extensions Release?

ASP.NET MVC
ASP.NET MVC provides model-view-controller (MVC) support to the existing ASP.NET 3.5 runtime, which enables developers to more easily take advantage of this design pattern. Benefits include the ability to achieve and maintain a clear separation of concerns, as well as facilitate test driven development (TDD).

The ASP.NET MVC Toolkit provides HTML rendering helpers and dynamic data support for MVC.

ASP.NET Dynamic Data
ASP.NET Dynamic Data helps developers build a fully customizable, data-driven app quickly. It provides a rich scaffolding framework that allows rapid data driven development without writing code, yet it is easily extendible using the traditional ASP.NET programming model.

ASP.NET AJAX
New additions to ASP.NET AJAX include support for managing browser history (Back button support).

ADO.NET Entity Framework
ADO.NET Entity Framework is a new modeling framework that enables developers to define a conceptual model of a database schema that closely aligns to a real world view of the information. Benefits include easier to understand and easier to maintain application code that is shielded from underlying database schema changes.

ADO.NET Data Services
ADO.NET Data Services provide new services that find, manipulate and deliver data over the web using simple URIs. Benefits include an easy and flexible way to access data over the web, while enabling the separation of presentation and data access code.

Silverlight Controls for ASP.NET
You can integrate the rich behavior of Microsoft Silverlight into your Web application by using two new ASP.NET server controls: a MediaPlayer server control that enables easy integration of media sources such as audio (WMA) and video (WMV) into your Web application, and a Silverlight server control that allows an ASP.NET page to reference both XAML objects and their event handlers.

Tags:
Mar 05

    Bir sene kadar önce yazdigim, Server Side MessageBox makalesini yazgeliştirden bulup inceleyen arkadaslar güzel bir kac yorum eklemişler,

Makaleler için :

http://www.yazgelistir.com/Makaleler/1000000779.ygpx

http://www.codeproject.com/aspnet/Server_Side_MessageBox.asp

Yorumlar için :

http://www.csharpnedir.com/forum2/forum_posts.asp?TID=8809

 

Tags:
Software Blogs TopOfBlogs