DayPilot Scheduler Control for ASP.NET

Fonte: http://www.codeproject.com/KB/webforms/daypilot_scheduler.aspx

Features

Main features:

  • Simple and clean look
  • Multiple resources on the Y axis
  • Customizable time scale on the X axis (one cell = 1 minute, 1 hour, 1 day, 1 week …)
  • Highlights business hours (customizable color)
  • Automatically handles concurrent events
  • Customizable event box (text, size, background color, duration bar…)
  • Customizable fonts and colors

Database connectivity:

  • DataSource and DataSourceID properties supported
  • SqlDataSource
  • XmlDataSource
  • DataTable
  • DataSet
  • ArrayList
  • and other sources…

Event handling:

  • Free time slot click event (automatic PostBack or manual JavaScript handling)
  • Calendar event click event (automatic PostBack or manual JavaScript handling)

Licensing:

  • Open-source (Apache Software License 2.0)

Compatibility:

  • Internet Explorer 6
  • Internet Explorer 7
  • Firefox 2
  • Firefox 3
  • Opera 9
  • Safari 2
  • Safari 3
  • Google Chrome 1

Background Information

DayPilot Scheduler reuses the event arranging algorithms introduced in the DayPilot Calendar control (Outlook-like day and week view calendar/scheduler):

DayPilot Calendar detects blocks of overlapping events so they could be displayed properly. The width of each event box is adjusted according to the number of concurrent events:

DayPilot Calendar detects blocks of overlapping events so they could be displayed properly. The width of each event box is adjusted according to the number of concurrent events:

DayPilot Scheduler uses the same arranging algorithm but the layout is different:

  • The Scheduler shows the time on the X axis.
  • Event box height is fixed.
  • Concurrent events are handled by increasing the row height, not by shrinking the event box.

This reduces the concurrency problem: The increasing number of concurrent events doesn’t reduce readability.

See Also

Minimum Setup Sample

Collapse | Copy Code
<DayPilot:DayPilotScheduler
  ID="DayPilotScheduler1"
  runat="server"
  DataSourceID="SqlDataSource1"
  DataStartField="start"
  DataEndField="end"
  DataTextField="name"
  DataValueField="id"
  DataResourceField="resource"
  StartDate="2009-01-01"
  CellDuration="60"
  Days="1" >
    <Resources>
      <DayPilot:Resource Name="Room A" Value="A" />
      <DayPilot:Resource Name="Room B" Value="B" />
      <DayPilot:Resource Name="Room C" Value="C" />
    </Resources>
</DayPilot:DayPilotScheduler>

The first group properties defines the data binding:

  • DataSourceID
  • DataStartField (starting DateTime)
  • DateEndField (ending DateTime)
  • DataTextField (event text)
  • DataValueField (event id)
  • DataResourceField (resource id)

DataResourceField is important – the values from this column will be matched with the resource IDs (Resource.Value).

The second group defines the time range and scale:

  • StartDate (first visible day)
  • Days (number of visible days)
  • CellDuration (cell duration in minutes)

And finally, it’s necessary to define the resources (rows):

  • Resource.Name (row name)
  • Resource.Value (row ID)

Usage Examples

Daily Scheduler

Settings:

Collapse | Copy Code
Days="1"
CellDuration="60"

StartDate is set manually in the code behind:

Collapse | Copy Code
DayPilotScheduler1.StartDate = DateTime.Today;

Weekly Scheduler

Settings:

Collapse | Copy Code
Days="7"
CellDuration="1440"

The first day of week is calculated using Week.FirstDayOfWeek helper:

Collapse | Copy Code
DayPilotScheduler1.StartDate = Week.FirstDayOfWeek(DateTime.Today, DayOfWeek.Monday);

Monthly Scheduler

Settings:

Collapse | Copy Code
CellDuration="1440"

In this case, it’s necessary to set the Days property manually:

Collapse | Copy Code
DayPilotScheduler1.StartDate =
	new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DayPilotScheduler1.Days =
	DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month);

Free/Busy Visualisation

This view doesn’t show event name (DataTextField is bound to an empty column).

Settings:

Collapse | Copy Code
DurationBarVisible="false"
EventBackColor="#4A71CE"

Timeline Visualisation

In the timeline view, the resources are replaced with events in the row headers. There is always just one event per row.

Settings:

Collapse | Copy Code
DurationBarVisible="false"
EventBackColor="#CA2A50"
Anúncios

Generate RSS Feed in ASP.Net

RSS feed is an xml formatted document that gives user the capability to read frequently updated contents on our websites without visiting our site. RSS feed has become one of the most sophisticated mechanism to share information on the internet world. It is one of the web 2.0 features which allows users to read their relevant information’s available on the internet. All we need to do is, get the RSS feed URL from different sites of our interest and subscribe it on our RSS reader. Before moving to actual implementation of RSS feed we will understand the format of RSS feeds that a RSS reader can consume.

For example, CodeDigest Rss feed will look like,

<?xml version=”1.0″ encoding=”utf-8″ ?>

<rss version=”2.0″>

  <channel>

  <title>CodeDigest.com Latest Articles</title>

  <link>http://www.codedigest.com</link&gt;

  <description>Latest articles hosted on CodeDigest.com.</description>

  <item>

  <title>Useful Datagrid Tips</title>

  <description>There are some frequent queries that are being asked in most of the forums and UG’s regarding datagrid. I have compiled a list of useful tips from my previous posts and posted it here.</description>

  <link>http://www.codedigest.com/Articles/ASPNET/77_Useful_Datagrid_Tips.aspx</link&gt;

  <pubDate>4/29/2008 9:47:12 AM</pubDate>

  </item>

</channel>

  </rss>

As we can see the above XML, the whole contents are packed inside <rss> tag. The actual information about the posts is kept inside <item> tag which in turn is packed inside a <channel> tag.  Moving forward this article will help us understand constructing an RSS feeds for our asp.net sites.

What we need to do?

Generating RSS feed for our website is nothing but emitting the frequently updated data in the above specified XML format. It can be done by constructing the XML document and performing a Response.Write of the constructed XML document.

 What should we use?

Our requirement can be achieved by performing a Response.Write on an ASPX page. But, in this article we will generate our RSS feed using HttpHandler instead of an ASPX page. There are some advantages in using HttpHandler over an ASPX pages, an ASPX page will have a series of events like OnInit, Page load, etc  which is not at all required in our case. These page level events are over head since we just want to get the data from database and construct a XML document and output the raw xml.

Implementation

With the RSS feed XML format in mind, we can construct XML using XmlTextWriter class. Include an HttpHandler to our project by right clicking solution and clicking “Add New Item”. Refer the below figure.

 

RSS.ashx

<%@ WebHandler Language=”C#” %>

 

using System;

using System.Web;

using System.Data;

using System.Text;

using System.Xml;

using DataAccess;

  public class Rss : IHttpHandler {

     ArticleDAO articleDAO = new ArticleDAO();

     public void ProcessRequest (HttpContext context) {

         // Clear any previous output from the buffer

           context.Response.Clear();

                   context.Response.ContentType = “text/xml”;

               XmlTextWriter cdRSS = new XmlTextWriter(context.Response.OutputStream, Encoding.UTF8);

 

        cdRSS.WriteStartDocument();      

 

        cdRSS.WriteStartElement(“rss”);

 

        cdRSS.WriteAttributeString(“version”, “2.0”);       

 

        cdRSS.WriteStartElement(“channel”);

 

        cdRSS.WriteElementString(“title”, “CodeDigest.com Latest Articles”);

 

        cdRSS.WriteElementString(“link”, “http://www.codedigest.com&#8221;);

 

        cdRSS.WriteElementString(“description”, “Latest articles hosted on CodeDigest.com.”);

 

        cdRSS.WriteElementString(“copyright”, “Copyright 2008 – 2009 CodeDigest.com. All rights reserved.”);

 

       //Connect database to get the data

        DataTable dtArticles = articleDAO.GetArticlesForRss();

 

        for (int i = 0; i < dtArticles.Rows.Count; i++)

        {

       //Build Item tags with the data from database

            cdRSS.WriteStartElement(“item”);

 

            cdRSS.WriteElementString(“title”, dtArticles.Rows[i][“Title”].ToString());

 

            cdRSS.WriteElementString(“description”, dtArticles.Rows[i][“description”].ToString());

 

            cdRSS.WriteElementString(“link”, “http://”+ context.Request.Url.Host + dtArticles.Rows[i][“URL”].ToString());

 

            cdRSS.WriteElementString(“pubDate”, dtArticles.Rows[i][“ApprovedOn”].ToString());

 

            cdRSS.WriteEndElement();

        }

 

        cdRSS.WriteEndElement();

 

        cdRSS.WriteEndElement();

 

        cdRSS.WriteEndDocument();

 

        cdRSS.Flush();

 

        cdRSS.Close();

 

        context.Response.End();     

 

    }

 

    public bool IsReusable {

        get {

            return false;

        }

    }

}

Font:  http://www.codedigest.com/Articles/ASPNET/86_Generate_RSS_Feed_in_ASPNet.aspx 

*********************************************

Soluções em desenvolvimento de sistemas com a DANRESA Consultoria.

Deploy an ASP.NET Form to a workflow

Published: 12 Jul 2010
By: Manning Publications

This article, taken from the book SharePoint 2010 Workflows in Action, shows you how easy it is to deploy an ASP.NET form to a workflow.

Contents [hide]

About the book

This is the 9th chapter of the book SharePoint 2010 Workflows in Action. It has been published with the exclusive permission of Manning.
Written by: Phil Wicklund
Pages: 400
Publisher: Manning
ISBN-10: 9781935182719

Get 30% discountDotNetSlacker readers can get 30% off the full print book or ebook at www.manning.com using the promo code dns30 at checkout.

ASP.NET forms can be a bit tricky to develop, but they’re easy to deploy. You add the form to a workflow, SharePoint 2010 packages everything up neat and tidy, and all that’s left for you to do is to deploy the project. Once you associate the workflow to a list or initiate the workflow on an item, SharePoint will recognize and use your custom ASP.NET form! The process takes seconds!

Once deployed, you’ll notice that the form is blank. Deployment was easy, but now it’s time to put our developer hat on and add some controls to that form, so users can pass data between the form and the workflow. To illustrate this process, we’ll create a generic initiation form. (Along the way, I’ll point out differences for association forms.)

Getting started

Let’s get started by creating a new sequential workflow project called TestASPNETWorkflowForms. Create a list workflow, and bind it to a list of your choice with the project provisioning wizard. After the project has been created, right-click on Workflow1, and choose Add, New Item. The new item dialog will appear (figure 1). Select a Workflow Initiation Form.

Figure 1: ASP.NET forms are extremely easy to integrate into a Visual Studio workflow. Simply right-click the workflow and add a new item.

After adding the form, SharePoint displays an ASP.NET HTML view of the form (figure 2). This auto-generated form has a button that’s wired and ready to go. To view the code behind the form, right-click it in the Solution Explorer and choose View Code. You’ll notice four auto-generated methods

  • Page_Load: Use this method to set default values for the fields on your form.
  • GetInitiationData or GetAssociationData: Our workflow calls this method to retrieve the values the user enters into the form. Simply return a string in this method that contains a serialized class with the form data stored in it. Then, on the workflow side of things, we can deserialze this class and the workflow can do something with the data.
  • StartWorkflow_Click: Submits the form.
  • Cancel_Click: Cancels the form

There’s not much to worry about with these methods because they’re complete as is. Usually, you won’t need to alter these methods, but they’re available, if you need to.

Figure 2: The auto-generated ASP.NET form has a button and controls wired and ready to go.

Adding Controls

Return to the ASP.NET HTML view (if necessary), so we can add a few ASP.NET controls. Inside the PlaceHolderMain content placeholder, add a few text boxes. We will use these text boxes to allow the user to enter information. To ship the user input values to the workflow, we’ll use the GetInitiationData method to return a string containing the data. We don’t want to pass just any string, we need a string that represents a serialized class that both the form and the workflow can instantiate and serialize/deserialize. To this purpose, right click Workflow1, choose Add and then select New Item. Choose a class file and then name the class InitiationFormParameters. Make the class public, and add two public strings, one for each parameter in the initiation form.

1.public class InitiationFormParameters
2.{
3.    public string InitiationParameter1;
4.    public string InitiationParameter2;
5.}

Back in the code behind of the ASP.NET form, find the GetInitiationData method. Add the code in Listing 1 to this method.

Listing 1: GetInitiationData method

01.string initdata = string.Empty;
02. 
03.InitiationFormParameters data = new InitiationFormParameters();        
04.data.InitiationParameter1 = InitParameter1.Text;                   
05.data.InitiationParameter2 = InitParameter2.Text;                   
06. 
07.using (StringWriter writer = new StringWriter())
08.{
09.    XmlSerializer s = new XmlSerializer(typeof(InitiationFormParameters));
10.    s.Serialize(writer, data);                         
11. 
12.    initdata = writer.ToString();
13.}
14. 
15.return initdata;

This code first creates an instance of our class and assigns properties to the user input values stored in the form . Next, it serializes that class into a string with a StringWriter, and then returns that string.

Our workflow calls the GetInitiationData method and loads the string into a property of the OnWorkflowActiviated activity called InitializationData (or AssociationData). Next, we must deserialize the stored string in InitializationData into a class the workflow can use. To do so, right-click the OnWorkflowActivated activity and choose Generate Handlers. Then, replace the onWorkflowActivated1_Invoked method with the code in Listing 2.

Listing 2 onWorkflowActivated1_Invoked method

01.string param1;
02.string param2;
03.  
04.private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
05.{
06.    XmlSerializer serializer = new XmlSerializer(typeof(InitiationFormParameters));
07. 
08.    XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(onWorkflowActivated1.WorkflowProperties.InitiationData));
09. 
10.    InitiationFormParameters initiationFormData = (InitiationFormParameters)serializer.Deserialize(reader);
11. 
12.    param1 = initiationFormData.InitiationParameter1;              
13.    param2 = initiationFormData.InitiationParameter2;
14.}

This code retrieves the user input data so the workflow can then perform some action on that data. The first thing we want to do is read the string out of the InitiationData property (or AssociationData) into an XmlTextReader. Then, we want to deserialize that XML into a new object that is the same type the string was serialized into (in this case the InitiationFormParameters object). After we have our object, we can start assigning some global variables or take other actions.

Our last step is to make sure everything is working, so add a LogToHistoryListActivity activity below the OnWorkflowActivated activity. We can use this history logger to render our form values on the workflow status page. After the LogToHistoryActivity activity is added, right-click it and choose Generate handlers. In the method that was generated, add the following code to display the user input values:

1.logToHistoryListActivity1.HistoryDescription = "Param1: " + param1 + " Param2: " + param2;

With this activity logging our form parameters, we can start testing. First, build and deploy the project. If you hadn’t already associated the workflow to a list, do so now. Otherwise, start the workflow on an item in the list. You should see our custom ASP.NET initiation form shown in figure 3.

Figure 3: Our initiation form will prompt the user for pertinent information when the workflow starts.

Enter some values and submit the form. The form will display a status of completed. Click the status column to view the workflow status page. Figure 4 shows the workflow history, with the user input values.

Figure 4: You can tell that the code ran correctly because the values you entered via the form are displayed on the workflow status page.

Designing websites for accessibility in Expression Web – Part I

Have you ever come across a requirement where you have to create web content that is accessible to people with disabilities? If yes, then you may find this article useful, if not, then the article will help you understand why your websites need to be accessible and how to go about making them accessible. Lets us understand the importance of accessibility and see how to get that in our websites.
Accessibility is a vast topic and there are many aspects to be considered while creating an accessible website. In this article, I have tried to touch upon some important points to be considered while making you website accessible.
What is website accessibility?
There are many definitions of web accessibility. I find this definition simple to understand – ‘a practice to make websites usable to people of all abilities and disabilities’. People with disabilities may be visually impaired so may not be able to see your pages or hearing impaired will not be able to listen to your podcasts or those who are immobile may not be able to use their mouse or keyboard.
When you design a website, you need to consider making your website accessible to all the users especially those with disabilities, so that they can understand and interact with the web.
How to create accessible websites?
To create an accessible website, means to create web content that is accessible for all type of users. First you create the web content and then you test it for accessibility. For better understanding, I have divided this topic into two parts. In this article (Part I) I will show you how to make you content accessible and in the next part of the article, we will see how to check the content for accessibility.
To make you content accessible, follow these tips:
Setting accessibility properties for an image
Whenever you insert an image in your web page, Expression Web prompts you with an Accessibility Properties dialog box as shown below:
accessibility_properties
Alternate text or alt text is a textual alternative to the image which makes it accessible to the screen reader users. Another usage of alternate text is, if an image is being downloaded on the page or when image cannot be found and user hovers over the placeholder of the image, a small piece of text would explain what the image is about.
This Accessibility Properties dialog box is prompted every time you insert an image on your page, unless you uncheck the option ‘ Show this prompt when inserting images’ (see image above). On the other hand, to add an alternate text to an existing image, you can double click the image in Design view and in the Picture Properties dialog box (shown below) and in the Accessibility section, insert the Alternate text.
picture_properties
Alternatively, you can always set the alt attribute of the <img> tag to describe the image. And similarly, add an alt attribute to any animations on your page.
Setting accessibility properties for text hyperlinks and hotspots
Text Hyperlinks:
a. Select the text you want to convert into a hyperlink and right click on it.
b. From the menu choose Hyperlink…
c. In the Insert Hyperlink dialog box, click on ScreenTip…
insert_hyperlink
d. Enter the ScreenTip text which acts like the alternate text. This will add a title attribute to the <a> tag.
In addition to above, Hyperlink text should be short meaningful and should make sense when read out of context, either particularly that link or along with other links.
Image maps:
Just as you add screen tips to text hyperlinks to make them accessible, use them to make the hotspots accessible too. Follow these steps:
a. Insert the image onto your web page.
b. In the Pictures toolbar (if not visible, right click on any toolbar and choose Pictures from the menu) choose rectangular or circular hotspot.
c. Draw a hotspot on the image.
d. The Insert Hyperlink dialog box pops up as shown above.
e. Click on the ScreenTip… button to insert the screen tip. This will add a title attribute to the <area> tag.
Creating accessible Tables
Though tables can be used in page layouts, they are best used to organize data. CSS should be used for Page layouts and styles.
NOTE: Expression Web has a set of layout tables that you can use to create page layouts. Using them is quite simple.
Have you ever come across a requirement where you have to create web content that is accessible to people with disabilities? If yes, then you may find this article useful, if not, then the article will help you understand why your websites need to be accessible and how to go about making them accessible. Lets us understand the importance of accessibility and see how to get that in our websites.
Accessibility is a vast topic and there are many aspects to be considered while creating an accessible website. In this article, I have tried to touch upon some important points to be considered while making you website accessible.
Image maps:
Just as you add screen tips to text hyperlinks to make them accessible, use them to make the hotspots accessible too. Follow these steps:
a. Insert the image onto your web page.
b. In the Pictures toolbar (if not visible, right click on any toolbar and choose Pictures from the menu) choose rectangular or circular hotspot.
c. Draw a hotspot on the image.
d. The Insert Hyperlink dialog box pops up as shown above.
e. Click on the ScreenTip… button to insert the screen tip. This will add a title attribute to the <area> tag.
Creating accessible Tables
Though tables can be used in page layouts, they are best used to organize data. CSS should be used for Page layouts and styles.
NOTE: Expression Web has a set of layout tables that you can use to create page layouts. Using them is quite simple.
Table accessibility is all about adding appropriate headers to data tables. Header tags solve the purpose. Header tags <th> should be descriptive enough to describe what the table is about. Table headers are recognized by most of the browsers and rendered as bold and centered. These cause them to be visually effective to the users.
NOTE: TableHeaders should be used only for data tables and not for layouts.
To create table headers follow these steps:
a. After inserting a table, choose a cell and right click.
b. Choose Cell Properties to open the Cell Properties dialog box.
cell_properties
c. Check the box ‘Header cell’ and click OK.
d. This will convert the <td> tags to <th> tags.
e. Enter a table header.
Creating accessible Forms
Forms are extensively used by websites either as contact forms, search forms; online shopping websites have forms to buy products, or airline booking forms and such other. Accessibility in forms is an extensive area in itself as forms are not very simple to navigate for people with disabilities. I will cover Form accessibility in detail in one of my future articles, however over here I will give you some tips you may find useful in order to make your forms accessible.
1. Labels: Labels are used to assign a label to any form control. Use the ‘for’ attribute to specify which form control is it associated with and ‘id’ attribute to assign a unique id. Make sure labels are close to the form elements.
2. Text fields and areas: It is very difficult for blind users to interpret what to enter in a text field/area. So enter a label for the text fields.
3. Radio buttons and Checkboxes: They are similar to the text fields but the text is displayed on the right hand side. A common example for radio button would be gender. You could use a group box for such examples to group the options to be chosen in a section. Group box is explained further in this list.
4. Input buttons: Input buttons could be a normal button, submit button or reset button. The value attribute for these buttons is important so that when a user hits the tab key to get to this button, when it gets focus, it will be highlighted with a dotted border. In case of a user using a screen reader or a talking browser, it announces the text on the button.
5. Image buttons: Enter an alt attribute for the image button.
6. Group box: A group box enters a set of <fieldset> and <legend> tags. See the code below:
<fieldset name=”Group1″>
<legend>Group box</legend>
</fieldset>
Fieldsets: The fieldset tag helps to group form elements such as address line 1, address line 2 and address line 3. The fieldset tag draws a box around its containing elements and groups them.
Legend tag: is used along with the <fieldset> tag to add a title to the element group and place it within the frame.
7. Select menus or Drop down boxes: The <select> tag allows you to group choices, a drop down. Provide an appropriate label to it.
Creating accessible Frames
Frames are used to display two or more web pages in a single visual space. To be able to make these frames accessible, add a title to each frame. This will help the screen reader users to listen to the title of each of these frames, helping them to know what each frame displays.
The content in the <noframes> tag should be always available to the users. You can use the <noframes> tag to tell the users what is being displayed in the frames and also give them links to the individual pages displayed in frames, in case they want to visit.
Conclusion
Accessibility is a vast topic and there are many aspects to be considered while creating an accessible website. In this article, I have tried to touch upon some important points to be considered while making you website accessible. I hope the article was helpful to you. In the next article we will check the accessibility of the websites using the Accessibility Checker feature available in Expression Web.

Expression Web 3.0 and 4.0 Articles Link List

A couple of days ago, we had posted a Link List of ASP.NET MVC, ASP.NET and jQuery Articles and Silverlight, .NET 4.0 and LINQ Articles Link List published on this site in the last 6 months. This week, we will be covering the articles on Expression Web 3 and 4. This list should help you stay updated with the content you might have missed on this site. Here’s the list:What’s new in Microsoft Expression Web 4? – In this article we will explore the new features available in Expression Web 4

Designing websites for accessibility in Expression Web – Part I – This article gives you an idea and tips of how to make your web site accessible

Designing websites for accessibility in Expression Web – Part II – In this article we will explore the Accessibility Checker feature of Expression Web and how to use it to test your website accessibility

Using jQuery to Open External Links in a New Window – Expression Web – This article is about using jQuery to open external links on your page in a new window

Changing the appearance of a picture in Microsoft Expression Web 3 – In this article we will be exploring only those options that enable you to edit a picture’s appearance on the webpage.

How to use Personal Web Packages in Microsoft Expression Web – A Personal Web Package contains pages, files and folders. In Expression Web, you can export or package a website or a group of files or folders so that someone else can import it and use it in their websites. In this article we will learn more about these web packages, how to create them and use them.

Setting the Frame properties in Expression Web 3 – In this article, we will look at various properties of frames

Setting the Page Editor Options in Microsoft Expression Web 3 (Part I) – With Page Editor Options you can specify settings for various Microsoft Expression Web features. In this article we will explore few tabs of the Page Editor Options dialog box.

Setting the Page Editor Options in Microsoft Expression Web 3 (Part II – Code Formatting) – With Page Editor Options you can specify settings for various Microsoft Expression Web features. In this article we will explore some more tabs of the Page Editor Options dialog box.

Setting the Page Editor Options in Microsoft Expression Web 3 (Part III – CSS tab) – In this article, we will explore the various CSS options that help you control how styles are generated by Microsoft Expression Web 3.

Setting the Page Editor Options in Microsoft Expression Web 3 (Part IV) – With Page Editor Options you can specify settings for various Microsoft Expression Web features. In this article we will explore few tabs of the Page Editor Options dialog box.

Creating scrollable content area using CSS overflow property in Expression Web – In this article, we will create scrollable content area by using the CSS overflow property for HTML divs in Expression Web

Preview Tools in Microsoft Expression Web 3 – Microsoft Expression Web 3 has built-in preview tools which you can use to test your web pages while designing them. In this article, I have listed the preview tools focusing more on the Development Server.

Explore CSS Properties Panel in Expression Web 3 – Expression Web 3 Panels (known as task panes in earlier versions) contain all the tools you would require while developing you web pages. Panels have been classified according to the type and categories of tools. All the panels are available in the Panels menu in Expression Web 3. In this article, we will explore the CSS Properties panel.

Expression Web Queries – Queries in Expression Web to search and replace a particular pattern or factor could be required often while developing a website. The Find and Replace dialog box in Expression Web has much to offer, than the traditional find and replace mechanism. You can create queries for the same. In this article we would take a deep insight into how to create such queries to pinpoint any misses in the code and search and replace intelligently.

Open and publish a live website in Microsoft Expression Web 3 – Expression Web lets you create website live on the server as well as create it offline and then upload to the server. Let us explore how to use each of these options to open and publish your website using FTP.

I hope you liked this list and I thank you for viewing it.

Fonte: http://www.dotnetcurry.com/ShowArticle.aspx?ID=541&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+netCurryRecentArticles+(.NET+Curry%3A+Recent+Microsoft+ASP.NET%2C+Silverlight%2C+WinForms%2C+Vista%2C+C%23%2C+VB.NET+Articles)&utm_content=Google+Reader

Using Dynamic Views In ASP.NET MVC 2

A really cool addition to ASP.NET MVC 2 is the ability to use the dynamic type as the object passed into the view. This is also known as a dynamic view. If you create a new view and don’t create a strongly typed view, out of the box, the MVC framework will make the view inherit from the ViewPage class, but the generic type will be dynamic, like this:

<%@Page Language=”C#” MasterPageFile=”~/Views/Shared/ViewMasterPage.Master” Inherits=”System.Web.Mvc.ViewPage”
<dynamic>”%>

Using the dynamic type is good because it allows you to create your objects on the fly. The downside of this is because the view is not strongly typed, you don’t get the compile time checking. For me compile time checking is a compelling reason to use strongly typed views.
In this example, I’m going to pass a collection of time zones into the view as a dynamic object to the view. To see this in action, I’m going to create a small ASP.NET MVC 2 website. If you haven’t got Microsoft Visual Studio 2010, you can download the Express edition here.
To begin, let’s add the view straight away. Normally you would do this after you have defined your action, but that’s not the focus of this article. By adding a view that is not strongly, we get to use the dynamic type. Here’s the view:
AddView
The HTML that’s added inherits from the ViewPage class, but the generic type is dynamic:
<%@Page Title=”” Language=”C#” MasterPageFile=”~/Views/Shared/ViewMasterPage.Master” Inherits=”System.Web.Mvc.ViewPage”
<dynamic>”%>
Cool huh?! Now I can add a dynamic object. I’m going to be displaying the list of time zones on your computer in a drop down list. Here’s the code:
<asp:ContentID=”Content2″ ContentPlaceHolderID=”MainContent” runat=”server”>
<%:Html.DropDownList(“DisplayName”,(IEnumerable=””
<SelectListItem> )Model.TimeZones) %>
</asp:Content>
I can access the dynamic type via the Model property which is available to the view by default. If you compiled this now, even though I haven’t created a real object, it will still compile.
Ok let’s add code to the controller to return the list of time zones. I’m adding this to the HomeController. Here’s the code below:
C#

public ActionResult GetTimeZones()
{
dynamic viewData = new ExpandoObject();
viewData.TimeZones = from p in TimeZoneInfo.GetSystemTimeZones()
select new SelectListItem
{
Text = p.DisplayName,
Value = p.Id
};
return View(“Index”, viewData);
VB.NET

Public Function GetTimeZones() As ActionResult
Dim viewData As Object = New ExpandoObject()
viewData.TimeZones = From p In TimeZoneInfo.GetSystemTimeZones()

Executar aplicações em background com Agendador de Tarefas Windows

Às vezes precisamos executar algumas aplicações em background, ou seja, sem que o usuário saiba disso. Alguns processos como integrações ou carga de dados.

Uma forma bem simples de se fazer isso é utilizar o Agendador de tarefas do próprio Windows localizado em: Painel de Controle\Todos os Itens do Painel de Controle\Ferramentas Administrativas.
image1

Para testar, vamos fazer uma aplicação console no Visual Studio. Abra o Visual Studio acesse File\New\Project e escolha o projeto Console Application conforme imagem 01.

A idéia é fazer uma aplicação que irá gerar um arquivo txt que irá registrar a hora atual.

Vamos mudar algumas opções para que a aplicação console seja executada sem exibir a janela do prompt do DOS.

Acesse as propriedades do projeto clicando com o botão direito do mouse no projeto e em propriedades conforme a imagem 02.
image2

Na guia application mude a opção Output Type para Windows Application conforme a imagem 03:
image3

Agora vamos programar para gerar o arquivo txt.  Na classe Program.cs digite o seguinte código no método Main:
image4

Pronto, temos uma aplicação console que gerar um arquivo txt salvado a hora atual, agora vamos compilar e gerar o executável.

Vamos agendar para que esse executável seja executado pelo agendador de tarefa. Após abrir o agendador de tarefa, clique na opção “Criar Tarefa ” no menu Ações localizado do lado direito.

A janela “Criar Tarefa será exibida”. De um nome para a tarefa, no meu caso “Executar aplicações em background com Agendador de Tarefas Windows” e clique na aba Disparadores. Clique em Novo e faça as configurações conforme a imagem abaixo:
image5
Acabamos de configurar a hora e a quantidade de vezes que o agendador de tarefa será executado. Clique em OK e acesse a guia Ações. Clique em Novo e a janela “Nova Ação” será exibida. Deixe a opção Iniciar um Programa na opção Ação e em Programa/script localize o nosso executável. Clique em OK. Pronto agora a cada um minuto o arquivo txt receberá a informação.

Perceba que o arquivo é modificado, porém, nenhuma janela e exibida para o usuário.

Recomendo pesquisas sobre o Agendador de Tarefa que existem outras opções como enviar e-mail.