Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

Hendrik Debedts

@Hendrik Debedts
About
Posts
22
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Extender controls may not be registered after PreRender
    H Hendrik Debedts

    let's have a look to my little dummy control again on this way it works, but is it the right way to work with a composite control? <ParseChildren(False, Nothing), PersistChildren(True)> _ Public Class CompositeTest Inherits CompositeControl Dim pnl As Panel Dim txt As TextBox Dim dde As AjaxControlToolkit.DropDownExtender Protected Overrides Sub OnInit(ByVal e As System.EventArgs) pnl = New Panel txt = New TextBox dde = New AjaxControlToolkit.DropDownExtender pnl.ID = "pnl" txt.ID = "txt" dde.ID = "dde" dde.TargetControlID = "txt" pnl.Controls.Add(txt) pnl.Controls.Add(dde) Controls.Add(pnl) MyBase.OnInit(e) End Sub Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) pnl.RenderControl(writer) End Sub End Class

    ASP.NET question help design

  • Extender controls may not be registered after PreRender
    H Hendrik Debedts

    I'm currently developing a compositecontrol, there was something I didn't understand, so I decided to create a little control to reproduce the problem to find out why this problem occurs. When running the following code I get the error above. <ParseChildren(False, Nothing), PersistChildren(True)> _ Public Class CompositeTest Inherits CompositeControl Dim pnl As Panel Dim txt As TextBox Dim dde As AjaxControlToolkit.DropDownExtender Protected Overrides Sub OnInit(ByVal e As System.EventArgs) MyBase.OnInit(e) pnl = New Panel txt = New TextBox dde = New AjaxControlToolkit.DropDownExtender End Sub Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) pnl.ID = "pnl" txt.ID = "txt" dde.ID = "dde" dde.TargetControlID = "txt" pnl.Controls.Add(txt) pnl.Controls.Add(dde) Controls.Add(pnl) 'MyBase.Render(writer) End Sub End Class The question is why does this happen? And where in a control's lifecycle will a (extender-) control be registered?

    ASP.NET question help design

  • Dynamically generated repeaters and the 'AddAt' method
    H Hendrik Debedts

    I want to use the 'AddAt' method with a dynamically generated repeater. It doesn't work. It's just like the whole repeater has only one item because i only can add an item 'before' or 'after' the whole repeater. I use this ItemTemplate class Public Class clsNavigatieDetail1ItemTemplate Implements ITemplate Private mboOpgevuld As Boolean Private moRepeater As Repeater Private msNavigatieDetail1 As String Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn Try If Not mboOpgevuld Then mboOpgevuld = True Dim oDataTable As DataTable oDataTable = CType(moRepeater.DataSource, DataTable) For i As Integer = 0 To oDataTable.Rows.Count - 1 Dim sItem As String sItem = "<div class='NavigatieMenuDetail1'>" sItem += "<div class='divMenuCell3' class='NavigatieMenuDetail1'> </div>" sItem += "<div class='divMenuCell4'>" sItem += "<a href='javascript:doPostback();setNavigatieDetail1 (" + oDataTable.Rows(i)("IDSubNavigatie1").ToString + ");'>" sItem += oDataTable.Rows(i)("OmschrijvingSubNavigatie") sItem += "</a>" sItem += "</div></div>" Dim oLiteralControl As New LiteralControl oLiteralControl.Text = sItem container.Controls.Add(oLiteralControl) Next End If Catch End Try End Sub Public Sub New(ByVal oRepeater As Repeater, ByVal sNavigatieDetail1 As String) mboOpgevuld = False moRepeater = oRepeater msNavigatieDetail1 = sNavigatieDetail1 End Sub End Class

    ASP.NET javascript design docker

  • Accessing printer status information
    H Hendrik Debedts

    I want to programatically access the printer status (usually get by printing off a status page). How do you do that? Greetz, Hendrik

    .NET (Core and Framework) question

  • DataGridViewComboBoxColumn Data Error
    H Hendrik Debedts

    I have a datagridview with a DataGridViewComboBoxColumn that contains items of self-builed types. When the selected value is changed i get a DataGridViewComboBoxColumn Data Error. Why does this happen?

    .NET (Core and Framework) question help

  • Table variables
    H Hendrik Debedts

    I'm writing a database class , I need to use a table variable from within .Net (C#), but it always gives an SQLException saying "Must declare the table variable '@Par1'." 1. I declared an SQLParameter object 2. I added the object to the 'Parameters' collection of the command How can I solve this

    .NET (Core and Framework) csharp database question

  • Exit For in C#?
    H Hendrik Debedts

    thx

    .NET (Core and Framework) csharp question

  • Exit For in C#?
    H Hendrik Debedts

    What's the 'Exit For' equivalent in C#?

    .NET (Core and Framework) csharp question

  • ReaderWriterLock [modified]
    H Hendrik Debedts

    By using this, what exactly is locked? A specifiek variable or the thread itself or the variables that have been modified with 'System.Threading.Interlocked.Increment'? I THINK 'THE VARIABLES THAT HAVE BEEN MODIFIED BY THE THREAD'. WRIGHT? If you have the following: public static void Synchronization_WriterLock() { System.Threading.ReaderWriterLock oReaderWriterLock; oReaderWriterLock = new System.Threading.ReaderWriterLock(); miCount = 0; try { oReaderWriterLock.AcquireWriterLock(100); try { System.Threading.Interlocked.Increment(ref miCount); Console.WriteLine(miCount); } finally { oReaderWriterLock.ReleaseWriterLock(); } } catch (ApplicationException e) { Console.WriteLine("Failed to get a Writer Lock"); } } What locks what? -- modified at 17:03 Wednesday 27th December, 2006

    .NET (Core and Framework) question

  • Sharing data across threads
    H Hendrik Debedts

    Thx

    .NET (Core and Framework) css com learning

  • Sharing data across threads
    H Hendrik Debedts

    Consider the following: namespace Lesson2 { class Program { static void Main(string[] args) { System.Threading.ThreadStart oThreadStart; oThreadStart = new System.Threading.ThreadStart(UpdateCount); System.Threading.Thread[] oThreads; oThreads = new System.Threading.Thread[10]; for (int i = 0; i < oThreads.Length; i++) { oThreads[i] = new System.Threading.Thread(oThreadStart); oThreads[i].Start(); } // Wait for them to complete for (int i = 0; i < oThreads.Length; i++) { /* * The different threads in 'oThreads' use the same * variable 'Counter.Count'. * => The variable 'Counter.Count' is shared by these threads. * * Without 'Join' the 'WriteLine' does his work before the * last thread is done. * => Total is less then 100.000. */ oThreads[i].Join(); } /* * Show to the console the total value of 'Counter.Count' *(after the 10 threads) * Should be 10 * 10.000 = 100.000 */ Console.WriteLine("Total: {0}", Counter.Count); Console.ReadLine(); } static void UpdateCount() { for (int i = 1; i <= 10000; ++i) { Counter.Count = Counter.Count + 1; } } } public class Counter { public static int Count; } } The expected 'Total' that is written to the console is '100.000' (10 threads that increment 'Counter.Count' with '10.000'). The book i'm currently reading (http://www.amazon.com/MCTS-Self-Paced-Training-Exam-70-536/dp/0735622779) says that if you run this code on a hyperthreading- or a multiprocessorsystem the 'Total' that is written to the console will sometimes be less than '100.000'. I don't understand the explanation.

    .NET (Core and Framework) css com learning

  • ExecutionContext
    H Hendrik Debedts

    Can anybody help me to understand and use 'ExecutionContext' (or give me za good link)

    .NET (Core and Framework) help

  • System.Xml.Serialization.XmlSerializer [modified]
    H Hendrik Debedts

    By initializing an 'XmlSerializer' object, you must specify what type of object you will serialize. Any idea why you must do this by using an 'XmlSerializer' and not when you are using a 'BinaryFormatter' or any other formatter? -- modified at 7:00 Friday 8th December, 2006

    .NET (Core and Framework) xml json question

  • 'OptionalField' attribute
    H Hendrik Debedts

    S O L V E D By using 'BinaryFormatter', the .Net Framework 2.0 doesn't give an exception if you do not use the 'OptionalField' attribute. But if u use the 'SoapFormatter', the meaning of the 'OptionalField' attribute becomes clear.

    .NET (Core and Framework) csharp dotnet visual-studio question

  • 'OptionalField' attribute
    H Hendrik Debedts

    Strange, I can't simulate an exception, what am i doing wrong? 1. Create a class 2. Create an object instance 3. Serialize this object 4. Add a field to the class (value or reference) 5. Deserialize (I supposed .Net would trow an exception here because there's a new field that isn't serialized, but it doesn't) I think it's just .Net 1.x that generate an exception -- modified at 4:58 Wednesday 6th December, 2006

    .NET (Core and Framework) csharp dotnet visual-studio question

  • 'OptionalField' attribute
    H Hendrik Debedts

    The meaning is writed as "If the member was not serialized, the CLR will leave the members's value null rather than throwing an exception." Visual Studio does the same thing as if this attribute was not used, so why should anyone use it? Or is it to garantee compatibility with .Net 1.x?

    .NET (Core and Framework) csharp dotnet visual-studio question

  • FileSystemWatcher question
    H Hendrik Debedts

    It's because a changed-event fires more than you probably expect, for example: - When you create a file - When you delete a file - When you rename a file - ...

    .NET (Core and Framework) question

  • Interfacecasting
    H Hendrik Debedts

    Oh yes you can, this code compiles without any problem ;) Here you pass an object of a class who implements the System.Collections.ICollection interface (Person) to a method that has a System.Collections.ICollection attribute (static void aMethod(System.Collections.ICollection i)) namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Person oPerson = new Person("Hendrik Debedts"); aMethod(oPerson); Console.ReadLine(); } static void aMethod(System.Collections.ICollection i) { Console.WriteLine(i); } } public class Person : System.Collections.ICollection { public string msNaam; public Person(string sNaam) { this.msNaam = sNaam; } public override string ToString() { return this.msNaam; } public void CopyTo(System.Array array, int index) { } public int Count { get { int anInteger = 0; return anInteger; } } public bool IsSynchronized { get { bool aBoolean = false; return aBoolean; } } public object SyncRoot { get { object anObject = new object(); return anObject; } } public System.Collections.IEnumerator GetEnumerator() { System.Collections.ArrayList arl = new System.Collections.ArrayList(); return arl.GetEnumerator(); } } }

    .NET (Core and Framework) question

  • Interfacecasting
    H Hendrik Debedts

    Yes ok, but if you can cast an object to an interface, it means that the class of the object implements the interface and when the class implements the interface you don't have firstly cast the object to the interface

    .NET (Core and Framework) question

  • Interfacecasting
    H Hendrik Debedts

    I know, but what is the need of doing this? Why should someone do this?

    .NET (Core and Framework) question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups