Adding a ScriptManager to all .aspx pages without changing the pages?

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

In DotNetNuke we have a specific situation, we develop modules for a bigger system which we cannot change that much… Unfortunatly that system cannot be changed that easily to add Ajax required functionalities, the easiest thing (without changing the core of the project) is to do changes to web.config.

In that purpose… if you want to use Microsoft Ajax in your modules (or in any other similar enviroment) you would need to be able to change web.config only. So how to succedeed in doing that?

Obviously the biggest problem is the ScriptManager, because it needs to be present in every .aspx page (DotNetNuke has only one… Default.aspx) for Ajax to work.

One workaround I found is to write a HttpModule which does the ScriptManager insertion in the request pipeline so that Ajax can work.


You can download this HttpModule here:

VladanStrigoNET.HttpModules.EnsureScriptManager.zip


You need to place the dll in the bin directory and add this to your HttpModules list in the web.config file:

name=EnsureScriptManager type=VladanStrigoNET.Web.HttpModules.EnsureScriptManager, VladanStrigoNET.HttpModules.EnsureScriptManager />

and it should work (it does for me :))!


If you still don’t understand “the big picture” of implementing Microsoft Ajax in your modules, don’t worry I am planning to write a guidance article which will explain the complete thing :)




Filed under: .NET, ASP.NET, Ajax, Best practices, DotNetNuke
Written on: 31 Jan 2007 · 2 Comments »

DNN & MS Ajax Best practices guidance

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

I’ve set a goal for myself to test and write a guidance article on how to use Microsoft Ajax with DotNetNuke (latest version, 4.4.1).

What I want to is to test if it’s possible (one by one) and then to show how to acomplish these scenarions within DotNetNuke with Microsoft Ajax:

  • Effective use of update panel - Partial rendering that works
  • Writting and using in the module your own Ajax controls
  • Use and implement JavaScript the Ajax way within a DotNetNuke module
  • Use Web Services and Page Methods within a module


My plan is to write one module which has all this, and show (describe) you the best way you can (or cannot) do these scenarios.

So let the games begin…


Filed under: Ajax, DotNetNuke
Written on: 31 Jan 2007 · 6 Comments »

A plan how and when I will increase my activity on the forums!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

I’ve thought about how I can get more involved into the Forums scene; especially the ones on ASP.NET and DotNetNuke site.

What I’ve decided is to do it like this:

Monday, Wednesday, and Friday - one hour beginning the day - I will answer posts on DotNetNuke site.

Tuesday, Thursday, and Saturday - one hour ending the day - I will answer posts on ASP.NET site


One extra thing is that I’ve agreed in my company to get 1 hour 3 times a week to surf the DotNetNuke forums, so actually that time spent on the DNN forums is covered by my company, which is GREAT! :)


So, let’s start with this plan and see where we end up…


Cheers! And see you on the forums :)


Filed under: General
Written on: 31 Jan 2007 · No Comments »

Cheat sheets for EVERYTHING! :)

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

One nice link I found this morning, it’s a site that has great cheat sheet documents on all the various subjects:

- NET Format String Quick Reference
- ASP.NET 2.0 Page Life Cycle & Common Events
- Visual Studio 2005 Built-in Code Snippets (C#)
- ASP.NET Page Life Cycle Diagram
- Visual Studio 2005 Default Keybindings C# | VB
- Microsoft ASP.NET AJAX Library
- VB.NET/C# Comparison
- HTML Character Entities
- CSS
- JavaScript
- XHTML
- Regular Expressions
- Microformats
- ASP/VBScript

Look it up, it can be really usefull:

http://john-sheehan.com/blog/index.php/net-cheat-sheets/


Cheers!



Filed under: .NET, ASP.NET, Best practices, C#, General
Written on: 30 Jan 2007 · No Comments »

Embracing Ajax… well what about Security?

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

With the 1.0 version of Ajax behind us, my company is looking into aspects of integrating MS Ajax into our future applications.

One thing that we’ve asked ourselfves is, well this is all great…. but what about security? We do all these nice web service calls, out of band requests… how does that relate to security issues?

So, I’ve digged a little into the subject and found some articles that might be of interest to you as well:

Top 10 Web 2.0 Attack Vectors
http://www.net-security.org/article.php?id=949

AJAX Security Talks
http://blogs.msdn.com/brada/archive/2006/12/18/ajax-security-talks.aspx

App security tools target Ajax vulnerabilities
http://searchappsecurity.techtarget.com/originalContent/0,289142,sid92_gci1189575,00.html

[UPDATE 26.01.2007]


Upcoming AJAX Security Webcasts
http://www.joeon.net/archive/2007/01/12/Upcoming-AJAX-Security-Webcasts.aspx


[/UPDATE]


These are by far only the starting point resources… when I found some others I will point them to you as well.


Cheers!


Filed under: ASP.NET, Ajax, Best practices
Written on: 25 Jan 2007 · No Comments »

Finally! Microosft Ajax 1.0 is released!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Wow….. this morning when I came to the office and read my batch of blogs I was very pleasently suprised to find that Microsoft has released a fully fledged version 1.0 of their Ajax framework.

You can’t imagine how I am happy to find that this has happened. WOW! :)

The details about the release are as always available on ScottGu’s great blog:

http://weblogs.asp.net/scottgu/archive/2007/01/23/asp-net-ajax-1-0-released.aspx

Ok.. I am going to calm down now… Have to do some work as well :)


Filed under: ASP.NET, Ajax
Written on: 24 Jan 2007 · No Comments »

C# at last…. Good bye VB… Heeello C#!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

The company for which I work for is traditionally a VB company… we started with VB, worked with ASP, and continued with VB.NET… it’s been a fine ride.

Over the years I came to realize that C# suits me better, I like the syntax better, I like the feeling better and lately I like the C# team a whole lot better than the VB one. Simply because they make better things for their language (in .NET 2.0 to name 2 of them… Code snippets and Nullables).

Well from this year my wish came through… my whole development department is going C#ish… we’ve decieded it’s just a better way.


The question came up… how do we train our development department to use C# instead of VB.NET?
One idea was to host a spree of short sessions recorded as webcasts in which we cover relevant areas? I personally didn’t like it as I think that migration from VB.NET to C# is just a matter of syntax and getting used to.

I’ve suggested to do instead of our regular Code Review at the end of the month a one day writeup of a small application in C#… the idea is to think of a small application and that everyone in the department writes it in C# on that day.

Of course for this we need some kind of help to the developers in the form of C# documentation, so my idea is to find/make a cheat sheet of vb.net to c# comparasment so that everyone can easily find at their fingertips something they already know how to do in VB.NET.


What do you think? Do you have any similar experiences?



Filed under: C#
Written on: 20 Jan 2007 · No Comments »

How to convert a „normal“ project to a DLinq (and probably Linq) enabled one?

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


Trying to execute DLinq queries in your project and receiving errors like this one?



You have a normal project which you’ve been developing for a while and now you want to enable it to be able to execute DLinq queries in it?

It’s actually quite simple, you need to modify 3 sections of your project file (Right click the project file –> Unload project –> Edit project ……):

  • References
  • Imports
  • Targets

Basically the three mentioned sections need to have the following (this is an example from a DotNetNuke Linq enabled module I am building made with my BlankModule development environment implementation):




and:



as you can see I’ve commented out the normal Visual Basic targets and added the LINQ ones.

Actually if you just open one of the LINQ enabled projects from the template (unroll it) you will see these same sections, references and imports there.


Hope this helps someone.

Cheers!


Filed under: .NET, ASP.NET, Linq DLinq XLinq
Written on: 16 Jan 2007 · No Comments »