October 2006 - Posts

ASP.NET AJAX JSON Date serialization

The Beta 1 Editon of Active Server Pages DOT NET Asynchronous Java Script And XML Java Script Object Notation (ASP.NET AJAX JSON) have changed the serialization of variables type data. The Christmas date 2000 will be included in a JSON String like

{"name":"Hannes","gebdat":"@977612400000@"}

I have no idea why and also no idea how to get the value as Jscript date object.

To get the JScript object from JSON String is easy by default.

var o;

o=eval('('+JSONSTRING+')');

Then the propertys can be accessed like

alert(o.name);

My workaround for extracting the date

var tmp =o.gebdat.split('@');

var heute= new Date(parseInt(tmp[1]));

alert(heute);

I have doubts that this is the best way. There must be some idea behind the @ format.

Posted by preishuber | 7 comment(s)
Filed under: , ,

TechEd, Exchange and Honeypot

Browsing the TechEd event site - a lot of application and services are available. Most based on ASP.NET.

Also Exchange is running. I am quite surprised that its still the "old" version. Anyway i have my personal email address emeahannesp@mseventseurope.com

And i post it here to see how much spam i have after the TechEd in my inbox.

Tip: take a look at the global addressbook

Posted by preishuber | with no comments

Layouting Formview without Tables and use CSS

I hate Detailsview. The editing of templates for each Column sucks. I prefer the Formview control which use one template per mode (insert, update, item). The problem is how to design this form cause there are no tables by default and also tables are not state of the art today.

Real ugly result and not what should be!

The second bad part shows up on rendering. The label text is rendered as plain text and also if you use ASP.NET label controls there is generated DIV tag. This is against accessibility rules. Microsoft have made in 2003 a patch for ASP.NET 1.1. But the same issue in 2.0!

Also the CSS Controls Adapters doesn't fix this kind of issue.

How should it be ( my opinion)

1) Formview wizard should automaticly create <LABEL> tags for the description in the IDE. "for" attribute point to the input field

  <LABEL FOR=email ACCESSKEY=e>e-Mail</LABEL>
Must be done by hand now.

2) You add a small style rule for the label width

<style>

label {

display: block;

float: left;

width: 80px;

}

</style>

Done!

You can watch the result on  session submission site of VSone.

Posted by preishuber | 7 comment(s)
Filed under: ,

Call for Papers VSone Germany Feb 2007

My company runs the biggest 3rd party microsoft conference in 2007. Five  conferences (ADC, ASP-Konferenz, SQL-Konferenz, VBmoves, VSone) will come together in Feb 2007 in Munich. We will cover a wide area of microsoft technology for developers and MS Tech users (eg Sharepoint, mobile).

We have a public call for papers on the main site www.vsone.de

There will also a Vendor track for exhibitors and a fasttrack for manager in which the most important features of microsoft products will be shown in half of session time (30 minutes).

Posted by preishuber | with no comments

Catching Data Exceptions and Display it in Validationsummary

When a SQLDatasource (or other DataSource Control) fail on a SQL operation a exception is fired like: duplicate key exception

user should not see the plain exception message. Goal is to display a custom message in validation summary.  My case use a formview control and a sqldatasource for inserting.  I hook into the Inserted Event and cancel the exception. A Customvalidator exists on page for error handling and is set to isvalid=false.

Protected Sub SQLDataSource1_Inserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)

If Not IsNothing(e.Exception) Then

e.ExceptionHandled = True

CustomValidator1.IsValid = False

End Sub

Most posts which i found by search engine are meaning that this is not possible. Partial true. The trick is that the Validationsummary and the Customvalidator must be placed outside the Formview, which works fine also for the other inside validation controls.

<asp:CustomValidator ID="CustomValidator1"

Display=none

runat="server" ErrorMessage="Email Adresse bereits vorhanden"

>

</asp:CustomValidator>

So easy!

Posted by preishuber | 1 comment(s)
Filed under: ,

My talks on TechEd Europe: ...

i have one talk on TechEd. Would really be great to see you in my session.

Open up your Applications with RSS Data Exchange (DEVWD29)

Dates and Times:

  • 7 November 2006 Start: 14:15 Finish: 15:30

Posted by preishuber | 1 comment(s)
Filed under: ,

German reunification and failed installation of LINQ

 

Today is holiday in Germany cause of the reunification 1990 of eastern and western Germany. So no business day and I am not in the office.

I decided to play around with some tools and try to install LINQ and BLINQ

Hmm I was quite surprised and have not seen ever before that my machine must be in the domain to install some software.

[UPDATE] As David pointed out. The Setup is looking for "Users" "Power Users" and "Creator Owner" and this fails in my German OS. I manual created it and setup works fine. I am still quite afraid on what's happens next.

Posted by preishuber | 1 comment(s)
Filed under:
More Posts