DCSIMG
December 2008 - Posts - Rotem Bloom's Blog

Rotem Bloom's Blog

Share knowledge on .NET and web development

News

About Me

Glad to help and share knowledge on .NET and also huge fan of Dream Theater.

Contact me via messenger

View Rotem Bloom's profile on LinkedIn

Dream Theater Pics

Blogs I Read

December 2008 - Posts

How to change ASP.NET CheckBox control Enabled property using javascript. bug or behavior?

Changing status to enabled\disabled for regular input type checkbox in javascript is very simple. You just need to use the javascript code:

var checkBox = document.getElementById("chkToTest");

checkBox.disabled = true\false;

Well try to use this javascript code above on ASP.NET checkbox web control when you set the server side Enabled property to false like below:

chkToTest.Enabled = false;

I'm telling you it will not work!!!!

Do you ask how to solve this bug or behavior?

You just need to set the disabled property of the parent node also. something like this:

var checkBox = document.getElementById("chkToTest");

checkBox.disabled = true;

checkBox.parentNode.disabled = true;

I don't know why but when setting the Enabled property of ASP.NET checkbox web control to false the control also render extra <SPAN> container for the checkbox and put disabled on the <SPAN> container element. So you also have to set the disabled property for this <SPAN> element, otherwise the javascript code will not work.

I wrote small application that demonstrate the problem, you can download it here.

Architecture Question Use ADO.NET Sync Framework Or Other Solution

היי,
יש לי התלבטות איך לממש משהו מסויים וחשבתי אולי ללכת על פיתרון של:
 Sync Framework of ADO.NET.
 
הדרישה בגדול היא לתת ליוזרים לעדכן נתונים במערכת ובזמן מסויים לאחר בדיקות תקינות של הנתונים לעלות אותם למערכת האמיתית של PRODUCTION בצורה אוטומטית.
האפליקציה כנראה תהיה ASP.NET על שרת IIS.
חשבתי שה-DB שה-ASP.NET יעדכן יהיה ה-DB הזמני וכאשר יוזר יחליט שהמידע תקין ומתאים לו הוא יוכל להעביר אותו ל-DB האמיתי ע"י לחיצה על כפתור או כל דרך אחרת.
 
מעניין אותי לדעת מה אתם חושבים? איך הייתם מממשים דבר כזה?
האם לפי הניסיון שלכם התשתית SYNC של ADO יכולה לתת לי מענה ברמה של:
ביצועים סבירים, תמיכה בסינכרון של מספר טבלאות עם קשרים בניהם (קשרים היררכיים), אמינות וכו'...
 
במידה ואתם מכירים דרך אחרת לפתרון אשמח לשמוע את דעתכם.
 
תודה רתם.
 

How to Modifies code generation for just-in-time (JIT) using code

Hi all,

Did you know that you can control JIT code generation using code? Well you can.

You can use the .NET DebuggableAttribute. The DebuggableAttribute controls how the runtime treats code within the module. The runtime might track extra information about generated code, and it might disable certain optimizations based on the values contained within this attribute.

How to use:

On your AssembllyInfo.cs file you can add the code: [assembly: System.Diagnostics.Debuggable(false, false)]

First boolean (IsJITTrackingEnabled) - Gets a value that indicates whether the runtime will track information during code generation for the debugger.

Second boolean (IsJITOptimizerDisabled) - Gets a value that indicates whether the runtime optimizer is disabled.

Posted: Dec 23 2008, 08:52 AM by Rotem Bloom | with 1 comment(s)
תגים:, ,

Increase, Change hard disk size, in Virtual PC

VhdResize will resize Microsoft's VHD files and will also convert between Fixed and Dynamic file types. This is a sector by sector copy operation from one size/type to the other and the source file remains unaltered.

VhdResize requires the Microsoft .Net 2.0 framework available via Windows Update and here.

You can download it from here.

More infrormation and updated version here.

Open source object database for .NET (object-oriented database)

Hi,

I'm doing some research on Database and Entities. I tested a great object database for .NET and JAVA open source called db4object.

"db4o is the open source object database that enables Java and .NET developers to store and retrieve any application object with only one line of code, eliminating the need to predefine or maintain a separate, rigid data model".

  • Native to Java and .NET
  • 100% object-oriented database, no object-relational mapping
  • Designed for embedded use
  • Open source and free under the GPL
  • db4objects offers the following products:

    What do you think? Cool haaaaaa

    Do we need to Releasing COM objects in .NET?? Write your opinion.

    Well,

    Good friend of mine, ask me interesting question: "Do I need to release my COM objects on my office add-in application I wrote in .NET??!!".

    It seems that there are different opinion on this issue. Do we have to use ReleaseComObject or let GC do the job for me?

    I have my opinion I will write later, but please write your opinion, I really wants to read what you think.

    Thanks,

    Rotem 

    Cross site Ajax plugin for Prototype

    Thierry Schellenbach has implemented a Prototype plugin that allows you to do cross site remoting using the dynamic script tag method that other frameworks such as Dojo and jQuery have supported for awhile.

    You can implement this by simply setting crossSite: true as a config parameter to Ajax.Request.

    Code example:

    new Ajax.Request('myurl', {
    method: 'GET',
    crossSite: true,
    parameters: Form.serialize(obj),
    onLoading: function() {
    //things to do at the start
    },
    onSuccess: function(transport) {
    //things to do when everything goes well
    },
    onFailure: function(transport) {
    //things to do when we encounter a failure
    }
    });
    the full information can be found on Thierry Schellenbach blog