Rants Tagged with “ASP.NET”
<< < 1 2 3 4 (Total Pages: 4/Total Results: 39)
This new property (*not* event), allows you to wire up clientside code to be executed before the server-side onclick is handled. In the old days we had to do this manually. For example, this is how you would hook up a simple confirmation dialog:
<script language="jscript" type="text/jscript">
<!--
function deleteConfirmation(event)
{
if (!window.confirm("Are you sure?"))
{
window.event.returnValue = false;
}
}
-->
</script>
<asp:LinkButton ID="deleteButton"
runat="server"
CausesValidation="false"
CommandName="Delete"
OnClick="deleteButton_Click"
OnClientClick="deleteConfirmation()"
Text="Delete">
</asp:LinkButton> This allows you to cancel the server-side event if the user says nope! Cool!
This probably isn't entirely correct since I am just looking at the output (e.g. the database rows) to determine this. For each object in profile (i.e. Users), there is a single row in the aspnet_Profile table. This table is made up like so:
CREATE TABLE [aspnet_Profile] (
[UserId] [uniqueidentifier] NOT NULL,
[PropertyNames] [ntext] NOT NULL ,
[PropertyValuesString] [ntext] NOT NULL ,
[PropertyValuesBinary] [image] NOT NULL ,
[LastUpdatedDate] [datetime] NOT NULL ) The three middle columns are used to store the properties and their values. PropertyNames stores a list of properties with hints on how to retrieve it from the String or Binary column. For example:
IsClient:S:0:4:Parent:B:0:-1:LogoUrl:S:4:39:Expired:B:0:-1:Row:B:0:-1:CssUrl:S:43:28:Services:S:71:239: Each section of this string is the metadata about the property:
- First is the name of a property. This needs to map directly to the property names in the web.config file.
- Then the place its to be stored (S = String, B = Binary). Note that the placement in String or Binary form is based on the datatype or the serialization format. XML Serialization ends up in Strings and binary serialization ends up in the binary area. It seems that numbers also end up in binary format.
- Start Position. For a string it's where in the string to start looking for that value. Understand that this will change as the size of the property changes. Using -1 in a Binary stored property seems to indicate that it is not stored at all. For example, the IsClient is a Boolean, but is stored as a string here, but Expired is also a boolean, but since it has a -1 we know it isn't actually stored.
- Length. If the start position is -1, there will be no length. Otherwise this is used to substring out the actual data in the string and binary fields.
As you would expect, the string field may be a mix of XML serialized data and string data. For example, the string field here is stored like so:
Truehttp://wildermuth.com/images/adoguylogo.gifhttp://wildermuth.com/adoguy.css
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>Cell Manager</string>
<string>Cell Manager</string>
</ArrayOfString>
You'll notice that the first four characters are the word "True" which corresponds to the PropertyNames "IsClient:S:0:4:". Likewise I have a property called Services which is the XML Serialized piece at the end that corresponds to "Services:S:71:239:".
So far I like the profile stuff and luckily it is using the common provider model because the one glaring weakness here is searching. Finding all Users with a specific Property value is going to be very very difficult. My plan is to write my own provider that is a specialization of the SqlProfileProvider but normalizing the data into a PropertyName and Value table. I have not dug deep into the ramifications as it has to do with Groups or custom serialized types, but I don't think they will get in the way.
If anyone has any comment on this, I am very open to hear what you have to say.
I am working on a portal project with ASP.NET 2.0 and I am loving it. Lots of stuff is in the box that I need. The project is using VB.NET so I wanted to make sure that everything was Option Explcit On and Option Strict On...but since it is a Web Application, the normal property pages are nowhere to be found (unless I am missing it). If I create any other project type (I think), I can look at the project property pages and see the Compile tab:

Why are web apps treated so differently these days? Can anyone explain how I missed this?
I've been digging deep in to ASP.NET 2.0 the last couple weeks and I have been pleasantly surprised by a number of nice changes that probably didn't make the new features lists:
- Markup Designer Errors: When you have a problem in the markup of a page and it can't show itself in the designer view, you get errors to follow up and fix (not the 1.1 version where it just complained about the first one).
- Localization Support: Wow! You can tell VS.NET to build resource based localization and the resource files are strongly typed.
- IIS Support for web.config: IT support for modifying the web.config file in IIS is sweet. The web-based one isn't bad, but the IIS one rocks.
In addition, I was surprised by the intuitive forms authentication controls. I was using the PasswordReminder control and wanted to capture the reminder and change the password to reset the password instead of remind them of their password since we were just storing the hashes. But after digging in deep, I found out that since I setup the personalization to store as hashes, it was resetting the password.
Of particular interest is the DataSetDataSource object which is being postponed. Though you can use the ObjectDataSource to bind to a Typed DataSet so it's not that much of a death-knell. Check it out...
Nice alternative to .Text/DasBlog. Includes Blog, Forum and Photo Gallery support.
I just wanted to give a shout out to Andy Smith of MetaBuilders ASP.NET controls. I regularly use his DialogWindow and FirstFocus controls. He has a number of controls on his site that are just great, but I can only speak for those two. My $0.02 review of them are:
- DialogWindow: This control is great in allowing a window to be opened and mimic a dialog window. Until the pop-up window is closed, the user can't play around with the main window. Setting these up is very trivial.
- FirstFocus: This control allows you to specify a control that will get focus when a user opens a form. This gets around my pet peeve around authors of websites that have forms forgetting to set the focus to the first control on a form. With this control, you drop it on a form and just specify the name of the control and it just happens.
Great work Andy!
This is a great document on the top ten application security holes that many sites are vulnerable to. These are application holes, not operating system or database security holes. These are insidious because many applications accidently leave these open in different ways. This document is great eduction for entire engineering groups on what to avoid in web site development.
I hear from a lot of readers that they are creating 3-tier ASP.NET apps and I always wonder if they know where the middle tier is.
In my opinion, the web server is the middle tier and client tier is the browser. Creating another set of machines to host the data layer isn't really necessary and, in fact, hosting the data layer on the web server is easier to scale. We know how to scale out web servers. Inventing a new set of machines forces you to figure out how to scale them out and it does not increase your scalability by scaling out both the web server and a fourth tier.
If you disagree, please e-mail me and let me know what you think.