The next release of ASP.NET provides the ability to have strongly-typed data templates on data controls and introduces new property called "ModelType". This property has two expressions: Item and BindItem. And, also provides full Intellisense and compile-time checking support.
This means developers who used Eval() and Bind() helper methods to bind data into a control,
First Name: <%# Eval("FirstName") %><br />
<asp:TextBox ID="firstName" runat="server" Text='<%# Bind("FirstName") %>' />
can use the property called "ModelType" on data controls introduced in ASP.NET vNEXT as below:
<asp:TextBox ID="firstName" Text='<%# BindItem.FirstName %>' runat="server" />
Search This Blog
Saturday, November 12, 2011
Monday, September 19, 2011
ASP.NET MVC 4 Developer Preview for Visual Studio 2010
Microsoft has released MVC 4 Developer Preview for Visual Studio 2010 and available to download from ASP.NET MVC 4 Developer Preview. ASP.NET MVC 4 can be installed and run with ASP.NET MVC 3 side-by-side.
Software Requirements:
1. .NET 4.o
2. Visual Studio 2010 SP1 or Visual Web Developer Express 2010
New features:
1. Enhanced ASP.NET MVC 4 project template allows you to create more modernized websites. The size of website is adjusted according to screen resolution.
2. Mobile project template - Develop web applications that can run on any phone. The MVC4 mobile template is based on JQuery Mobile framework.
3. Enhanced support for asynchronous methods.
Software Requirements:
1. .NET 4.o
2. Visual Studio 2010 SP1 or Visual Web Developer Express 2010
New features:
1. Enhanced ASP.NET MVC 4 project template allows you to create more modernized websites. The size of website is adjusted according to screen resolution.
2. Mobile project template - Develop web applications that can run on any phone. The MVC4 mobile template is based on JQuery Mobile framework.
3. Enhanced support for asynchronous methods.
Tuesday, September 6, 2011
HTML 5 Input Type - Number
HTML 5 Number Input type control allows user to increase or decrease the value of the textbox by clicking on up or down arrow buttons. As of today, only Chrome 13 and Safari 5 support this feature.
<!DOCTYPE html>
<html>
<head>
<title>Testing HTML 5 Number Input Type</title>
</head>
<body>
<form>
<label for="date">
Please enter date:
<input type="number" name="date" id="date"
min="1" max="31" step="1" value="15">
</label>
</form>
</body>
</html
Friday, September 2, 2011
Method Overloading in ASMX and WCF services
Both ASMX and WCF services do not support method overloading by default. However, it is possible to enable method overloading with ASMX or WCF service by decorating a ASMX web method or a WCF method as follows.
In ASMX:
[WebMethod (MessageName="HelloWorld")]
public string HelloWorld()
{
return "HelloWorld";
}
[WebMethod (MessageName="HelloWorldWithName")]
public string HelloWorld(string name)
{
return "HelloWorld " + name;
}
In WCF:
[ServiceContract]
public interface IMyCalculator
{
[OperationContract(Name="AddFloats")]
float Add(float operand1, float operand2);
[OperationContract(Name="AddIntegers")]
int Add(int operand1,int operand2);
}
In ASMX:
[WebMethod (MessageName="HelloWorld")]
public string HelloWorld()
{
return "HelloWorld";
}
[WebMethod (MessageName="HelloWorldWithName")]
public string HelloWorld(string name)
{
return "HelloWorld " + name;
}
In WCF:
[ServiceContract]
public interface IMyCalculator
{
[OperationContract(Name="AddFloats")]
float Add(float operand1, float operand2);
[OperationContract(Name="AddIntegers")]
int Add(int operand1,int operand2);
}
Thursday, September 1, 2011
Silverlight 5 Release Candidate is available to download.
Microsoft has published (8/31/2011) Silverlight 5 Release Candidate and available to download from the following link.
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27220
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27220
Tuesday, August 30, 2011
HTML 5 support in Visual Studio 2010
HTML 5 support in Visual Studio 2010 was something development community was asking for a long time. Web Standards Update for Microsoft Visual Studio 2010 SP1 adds support to Visual Studio and the editor for HTML5 and CSS3 and provides intellisense and validation according to W3C specification.
http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83
http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83
Tuesday, August 23, 2011
How to enable WCF Tracing?
Tracing is not enabled by default. Trace source should be defined in the assembly level. The System.ServiceModel and System.ServiceModel.MessageLogging are the most important and frequently used WCF trace sources.
For each trace source trace listener should be defined. You can configure tracing by editing the web.config for web-hosted applications, or Appname.exe.config for self-hosted applications.
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\log\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
You can also configure each trace source to use the same shared listener, as shown below.
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="CardSpace">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.IO.Log">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.Runtime.Serialization">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.IdentityModel">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\log\Traces.svclog" />
</sharedListeners>
</system.diagnostics>
</configuration>
For each trace source trace listener should be defined. You can configure tracing by editing the web.config for web-hosted applications, or Appname.exe.config for self-hosted applications.
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\log\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
You can also configure each trace source to use the same shared listener, as shown below.
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="CardSpace">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.IO.Log">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.Runtime.Serialization">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.IdentityModel">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\log\Traces.svclog" />
</sharedListeners>
</system.diagnostics>
</configuration>
Friday, October 15, 2010
How to find ASP.NET temporary files location?
ASP.NET provides the HttpRuntime.CodeGenDir property which gets the physical path to the directory where ASP.NET stores temporary files (generated sources, compiled assemblies, and so on) for the current application.
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(HttpRuntime.CodegenDir);
}
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(HttpRuntime.CodegenDir);
}
Thursday, September 2, 2010
Overview of ASP.NET AJAX
ASP.NET AJAX is a free platform-independent scripting framework for quickly creating efficient and interactive Web applications that works across all popular browsers. AJAX enhances the user interactivity by providing asynchronous postback functionality which enables partial-page updates and fewer page refreshes.
ASP.NET does provide many tools that make building AJAXenabled webpages easier. ASP.NET ships with a set of AJAX server controls that can be embedded in your webpages to enable partial-page updates, communicate with a server process to indicate progress, and periodically update portions of a page.
ASP.NET does provide many tools that make building AJAXenabled webpages easier. ASP.NET ships with a set of AJAX server controls that can be embedded in your webpages to enable partial-page updates, communicate with a server process to indicate progress, and periodically update portions of a page.
■ The ScriptManager control is required on all pages that work with the AJAX Extensions for ASP.NET. It manages the JavaScript files sent to the client and the communication between the server and the client.
■ The ScriptManagerProxy control is used on pages that work with a master page that already defines a ScriptManager control or with user controls that will be used on pages that include a ScriptManager control.
■ The UpdatePanel control allows you to define an area within your page that can post back to the server and receive updates independent of the rest of the page.
■ The UpdateProgress control is used to provide notice to the user that the page has initiated a callback to the server.
■ The Timer control is used to periodically send a partial-page request (by using an UpdatePanel control) to the server at timed intervals.
Partial page updates - The ability to do a partial or incremental page updates without doing a full postback to the server, with no code changes and minimal markup changes. This ensures that the user stays within his or her current context. It also gives users the feeling that they are interacting with the application and not a server.
Client-side processing - This interactivity provides immediate feedback and responsiveness to users. With client script, you can enable functionality such as collapsible areas of a page, tabs on a webpage, data sorting on the client, and much more.
Progress indication - Track the progress of a server-side process and continuously update the user. This gives users the feeling that they are in control and assures them that the application is still processing.
Client-side processing - This interactivity provides immediate feedback and responsiveness to users. With client script, you can enable functionality such as collapsible areas of a page, tabs on a webpage, data sorting on the client, and much more.
Progress indication - Track the progress of a server-side process and continuously update the user. This gives users the feeling that they are in control and assures them that the application is still processing.
Subscribe to:
Posts (Atom)