Contents tagged with ASP.NET
-
Modified MVC AccountController for Preview 5
I just downloaded the ASP.NET MVC Preview 5 bits from Codeplex and started on my first experiment.
-
Asp.net 2.0 On Tour
On March 2, 2005 the ASP.NET 2.0 On Tour came to Belgium, Brussels. This is an international tour, all about the latest Microsoft technology, featuring speakers such as David Platt and Dave Webster.
The subjects of this event were about showing what ASP.NET 2.0 and Visual Studio 2005 had to offer, and how to migrate to these new products and technologies.
One of the sessions was about “Personalization & Membership in ASP.NET 2.0”, by Gunther Beersaerts and Bart De Smet, which was very nice thanks to the good balance between demos and slides.
They talked about the Membership Service, which takes care of the management of users, password generating, validating logins and everything else related to authentication. Other areas of ASP.NET 2.0 they touched were the Role Management Service and the Profile Service.
Trough the Role Management Service, everything related to authorization based on roles can be done in a simple way with static methods to perform key management tasks. While the Profile Service takes care of storing user-specific data persistently in a strongly typed manner, thus making it very easy to customize your site to the logged on user.
This event really gave a good view on what is to come in the web development area. -
Troubleshooting DotNetNuke 2.1.2 Installation
I had a lot off trouble installing DotNetNuke. This popular portal application kept me busy for an entire afternoon and night.
First I got ASP.NET errors about columns missing in tables, then about stored procedures. When those were gone, the application itself managed to hang IE.
So, for everyone else who might be suffering from this, or will give it a try and encounters the same, here's my installation guide for 2.1.2:
The SQL errors occured when using SQL Server as Data Provider, the IE errors always occur.
This step is for everyone using SQL Server:
- Download DotNetNuke_2.0.4.zip.
- Extract this, follow the normal installation procedure, this version doesn't give any problems.
- Open the site so that it creates the tables and stored procedures.
- Download DotNetNuke_2.1.2.zip.
- Delete all files from 2.0.4 but keep your SQL Server tables.
- Extract 2.1.2 in the same location.
- Open the site, now you got passed the missing columns errors!
- Download DotNetNuke_2.1.1.zip.
- Extract this to a temporary location and get the file spmenu.js from controls\SolpartMenu.
- Copy this file to 2.1.2 overwriting it.
- You now fixed the IE errors!
Let's hope future versions don't require so much hasstle. -
Controlling a Usercontrol from another Usercontrol
Today I received a question on how to make a usercontrol visible from another usercontrol. You could also see this as: "How could a usercontrol control everything from another usercontrol?"
Normally you wouldn't do this kind of stuff (at least not in my opinion). Usercontrols are to ASP.NET what modules were for VB6, and just like another class, they should function without knowing what's outside their borders, like small functional containers.
Let's take a look at this. First I created a normal page, Default.aspx, and I also made two usercontrols, Control1.ascx and Control2.ascx.
Control2.ascx only has a label, and Default.aspx contains the two usercontrols (named UControl1 and UControl2). Control1.ascx has a button on it, called cmdMakeVis.
First I tried making UControl2 as a public property in Default.aspx, and accessing it from UControl2 through there, unfortunately that gave me an object reference not set error.
My second attempt turned out fine though:
I took the Default.aspx page out of the Context.Handler and searched for UControl2 on it. If I would find it, I could control it. Good thing it worked ;)
Here's the code the button contains:1private void cmdMakeVis_Click(object sender, System.EventArgs e) {
I also uploaded this small test project as an illustration.
2 TestSite.DefaultPage Default = (DefaultPage)Context.Handler;
3 TestSite.Control2 UserControl2 = (Control2)Default.FindControl("UControl2");
4 if (UserControl2 != null) {
5 UserControl2.Visible = true;
6 }
7} /* cmdMakeVis_Click * -
Writing Secure ASP.NET Session - Dutch
It has been a long time since I posted something, but here I am again. It's a very busy time right now, some exams, loads of school tasks, some websites, etc..
And also, a talk I had to prepare for class. One that I'm going to share with you.
I'll have to dissapoint non-Dutch readers though, the slides are writting in Dutch, as it was a local session. You could always look at the code though.
The subject was 'Writing Secure ASP.NET'. Covering :- Cross-site Scripting
- SQL Injection
- Hashing passwords
- IOPermissions by default
- Unsafe DSN (DSN with password included)
You can find all files here: SecureASPNET.ppt (227k) and Demo.zip (205k). -
Differences between PHP and ASP.NET
if (((number == 5) && (number2 != 8)) || (admin == true)) {