Apr 4 2007

RegisterHiddenField and ID property

Category: ASP.NET 2.0 - GeneralBil@l @ 10:43

In a previous post I talked about the xListBox and MoverList Controls. I did some fixes to make them work for FireFox and IE.

What was the problem actually? If you read the article about xListBox, you will notice that I have based on solution on a HiddenField to keep track of added/removed items from the ListBox on the client side and to reflect the changes on the server side.

The problem was that, RegisterHiddenField in ASP.NET 1.1, was not generating an ID for the hidden field on the HTML and I was using the document.getElementById, FireFox was having a problem in this, while IE as usual has no problem with anything [:D].

I could have used document.getElementByName, but I prefered to use the one by ID. So what I did is that, I had to customize the way the RegisterHiddenField works. The idea I got from this post: ASP.NET's RegisterHiddenField and document.getElementById

However, I had to modify it a bit to look something as:

    string hiddenFieldName = this.ClientID + "_REMOVED";
    if (!HttpContext.Current.Request.Browser.ToString().Equals("IE"))
        hiddenFieldName =  hiddenFieldName + "\"" + " id=\"" + hiddenFieldName;

This way, I did a trick to add the name of the HiddenField and an ID for the HiddenField and that worked perfect!!

Maybe you can use this trick in your work somewhere!

Hope this helps,
Regards

Tags:

Jan 23 2007

ASP.NET AJAX 1.0 Released

Category: ASP.NET 2.0 - GeneralBil@l @ 21:29

Scott Guthrie just announced the release of the ASP.NET AJAX 1.0 .

Check his post here: ASP.NET AJAX 1.0 Released

 

Regards

Tags:

Jan 18 2007

Server Variables

Category: ASP.NET 1.x | ASP.NET 2.0 - GeneralBil@l @ 10:03

I always find a difficulty in remembering all the server variables and how they can help me, here is a list of all the server variables I ran in a testing application. You will see the server variables with a sample data coming from the testing application:

ALL_HTTP HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:en-gb HTTP_HOST:localhost HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
ALL_RAW Connection: Keep-Alive Accept: */* Accept-Encoding: gzip, deflate Accept-Language: en-gb Host: localhost User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
APPL_MD_PATH /LM/w3svc/1/root/Testing
APPL_PHYSICAL_PATH C:\Projects\Testing\
AUTH_TYPE  
AUTH_USER  
AUTH_PASSWORD  
LOGON_USER  
REMOTE_USER  
CERT_COOKIE  
CERT_FLAGS  
CERT_ISSUER  
CERT_KEYSIZE  
CERT_SECRETKEYSIZE  
CERT_SERIALNUMBER  
CERT_SERVER_ISSUER  
CERT_SERVER_SUBJECT  
CERT_SUBJECT  
CONTENT_LENGTH 0
CONTENT_TYPE  
GATEWAY_INTERFACE CGI/1.1
HTTPS off
HTTPS_KEYSIZE  
HTTPS_SECRETKEYSIZE  
HTTPS_SERVER_ISSUER  
HTTPS_SERVER_SUBJECT  
INSTANCE_ID 1
INSTANCE_META_PATH /LM/W3SVC/1
LOCAL_ADDR 127.0.0.1
PATH_INFO /Testing/WebForm1.aspx
PATH_TRANSLATED C:\Projects\Testing\WebForm1.aspx
QUERY_STRING  
REMOTE_ADDR 127.0.0.1
REMOTE_HOST 127.0.0.1
REMOTE_PORT 2368
REQUEST_METHOD GET
SCRIPT_NAME /Testing/WebForm1.aspx
SERVER_NAME localhost
SERVER_PORT 80
SERVER_PORT_SECURE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/5.1
URL /Testing/WebForm1.aspx
HTTP_CONNECTION Keep-Alive
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE en-gb
HTTP_HOST localhost
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

 

Hope this helps,

Regards

Tags: ,

Jan 18 2007

Transactions in .NET 2.0

Category: ASP.NET 2.0 - GeneralBil@l @ 06:49

I was introduced yesterday to the new namespace in .NET 2.0 about Transactions. Transactions at the business layer (C#  domain objects) without the use of COM+ Transactions. There are two kinds Light Weight that depends on the SQL Server 2005 (single connection), once more than one connections are used, the Light Weight Transaction Manager will be promoted to OleTX Transaction Manager which is internally based on COM+.