jQuery and ASP.NET
A great news, Microsoft will be shipping jQuery with Visual Studio soon. The first shipment will be to support jQuery intellisense in Visual Studio as a free download.
A great news, Microsoft will be shipping jQuery with Visual Studio soon. The first shipment will be to support jQuery intellisense in Visual Studio as a free download.
ASP.NET AJAX 4.0 Preview 1 was released on July 21.
This release contains a preview version of the following features (that are also described in our Roadmap document: http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14924):
* Client-side template rendering
* Declarative instantiation of behaviors and controls
* DataView control
* Markup extensions
* Bindings
One good news for JSON lovers, this is from release notes:
In the next version of ASP.NET AJAX, we plan on enabling new client-side data scenarios for both page and component developers. You will be able to get JSON data from the server and present it as HTML on the client in a highly manageable and performant way.
You may see the CodePlex project at http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=15511
Some of you might have already realized that DataPager does its job only if you use a DataSource control. For instance, if you want to set a ListView’s DataSource property in page’s Load event and expect DataPager control to successfully page the ListView control, it means that you will need to spend your hours to find why it does not work.
Even though I still can’t figure out why it does not work, here is the workaround. Just create a DataSource control (e.g.: LinqDataSource) control just with “ID” and “runat” properties and then hook the “Selecting” event. Also set the ListView’s “DataSourceID” property to the ID of the DataSource control. What you will do there is to set the “Result” property of the SelectEventArgs argument.
<asp:LinqDataSource ID="LinqDataSource1" runat="server" OnSelecting="LinqDataSource1_Selecting">
</asp:LinqDataSource>
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
e.Result = GetDataSource(); // Assuming that GetDataSource method returns the datasource.
}
Now you can save your hours.
In case you get the following exception while trying to run an ASP.NET application, the solution is not as simple as setting the "enableEventValidation" configuration to "false" all the time.
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
I had such a problem last week. One of my colleagues asked me to check a problem because he could not see it and everything used to work perfectly before. I must confess that I spent hours to find the problem. Even if I set the "enableEventValidation" value to "false", nothing worked and everything started to lose its ViewState data.
Finally, I’ve found that the problem was a forgotten "form" tag within a user control. So, if you have such a problem about losing ViewState unexpectedly and exceptions about Event Validation, double check your code not to have such <form> tags.
If you need to divide the web.config or app.config file into pieces for any reason - imagine you just don’t like a lot of settings of components that you will never need to change - it is even possible in .NET. The only thing you have to find out is how to use “ConfigSource” property of System.Configuration.SectionInformation (MSDN: Contains metadata about an individual section within the configuration hierarchy.) class.
Each configuration section that derives from this class has the ability of getting its configuration settings from a separate “config” file.
In a case that you would like to store your connections strings in a different “config” file, the way you have to follow is shown in the example below.
web.config file:
<?xml version="1.0"?>
<configuration>
<connectionStrings configSource="ConnectionStrings.config" />
<system.web>
<!-- settings... -->
</system.web>
</configuration>
ConnectionStrings.config file:
<connectionStrings> <clear /> <add name="SqlServer" connectionString="..." /> </connectionStrings>
I know that we all have been waiting for this great news for a long time. Now you can download symbols for .NET Framework source code and you can see or even debug the framework’s itself.
ScottGu has a long post describing how you can access this feature in Visual Studio 2008.
This is what he says:
Last October I blogged about our plan to release the source code to the .NET Framework libraries, and enable debugging support of them with Visual Studio 2008. Today I’m happy to announce that this is now available for everyone to use. Specifically, you can now browse and debug the source code for the following .NET Framework libraries:
.NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, etc).
ASP.NET (System.Web, System.Web.Extensions)
Windows Forms (System.Windows.Forms)
Windows Presentation Foundation (System.Windows)
ADO.NET and XML (System.Data and System.Xml)
We are in the process of adding additional framework libraries (including LINQ, WCF and Workflow) to the above list. I’ll blog details on them as they become available in the weeks and months ahead.
To read the rest of the post, please follow this page.
If .NET Framework insist on not telling you what the exception was then you have to start checking Context.AllErrors.
I wanted to check what can be the reason to make GetLastError() method angry with myself and tried search engines to see what other people say about it. Most of the people keep writing that GetLastError method of Server object returns null if you want to call it inside a page’s load or in the error page that causes a redirection and makes you loose the Exception object.
Well, I really don’t try to implement a page specific error handling architecture. What I am doing is simply trying to access the last error within the Error event of the Context instance in my custom IHttpModule.
After finishing a project and deploying it on a public server, it is normal that you expect some problems or to-dos like some configuration changes in “web.config” file or somewhere else if you preferred implementing your own configuration architecture.
The question is that if you would expect something to break depending on your choice of deployment, e.g. Precompiled deployment or not. My answer was no until 3 days ago but it is a screaming “YES” for now.
What I am talking about is System.Web.Hosting.VirtualPathProvider class located in System.Web assembly. This class insists on not registering itself to the HostingEnvironment (System.Web.Hosting.HostingEnvironment) if you prefer deploying your website using precompilation.
Microsoft ASP.NET 3.5 Extensions Preview hakkında oldukça işe yarar 2 makaleye eriştim. Sizlerle de paylaşmak isterim.
Eğer Visual Studio üzerinde bir web projesi açmak ya da oluşturmak isterken, The web server reported the following error when attempting to create or open the web project located at the following URL: ‘http://localhost/projeIsmi’, ‘P/1.1 500 Internal Server Error’. şeklinde bir hata alıyorsanız, aşağıdaki adımları takip etmeniz durumunda sorundan kurtulabilmeniz olası: