server side control and undefined value

  • Thread starter Thread starter Boris Nieuwenhuis
  • Start date Start date
B

Boris Nieuwenhuis

Hi,
I noticed this behaviour more often.
in the visual c# editor of .NET 1.1 if select a HTML control and then select
it in the form editor and then right click and select run as server control,
thhus changing it to a server side control, sometimes these controls don't
get initialised in the code behind.
For instance, now I have a radio group of 5 radio button, and I selected
them an made them run at server. If i put a breakpoint in my code behind in
the page_load on these lines of code
if(Request["rdoAbonnement"]!=null){
if(Request.Form["rdoAbonnement"].Equals(Radio1.Value)){do something}
if(Request.Form["rdoAbonnement"].Equals(Radio2.Value)){do something}
if(Request.Form["rdoAbonnement"].Equals(Radio3.Value)){do something}
if(Request.Form["rdoAbonnement"].Equals(Radio4.Value)){do something}
if(Request.Form["rdoAbonnement"].Equals(Radio5.Value)){do something}
}
However Radio3 is a null reference, this control reference doesn;'t get
initialises. I saw this behaviour more often and with different types of
controls.
Anybody got an idea?
Greetz Boris
 
Sorry

Pent said:
This is VC++ groups. check ...csharp, aspnet

Boris Nieuwenhuis said:
Hi,
I noticed this behaviour more often.
in the visual c# editor of .NET 1.1 if select a HTML control and then select
it in the form editor and then right click and select run as server control,
thhus changing it to a server side control, sometimes these controls don't
get initialised in the code behind.
For instance, now I have a radio group of 5 radio button, and I selected
them an made them run at server. If i put a breakpoint in my code behind in
the page_load on these lines of code
if(Request["rdoAbonnement"]!=null){
if(Request.Form["rdoAbonnement"].Equals(Radio1.Value)){do something}
if(Request.Form["rdoAbonnement"].Equals(Radio2.Value)){do something}
if(Request.Form["rdoAbonnement"].Equals(Radio3.Value)){do something}
if(Request.Form["rdoAbonnement"].Equals(Radio4.Value)){do something}
if(Request.Form["rdoAbonnement"].Equals(Radio5.Value)){do something}
}
However Radio3 is a null reference, this control reference doesn;'t get
initialises. I saw this behaviour more often and with different types of
controls.
Anybody got an idea?
Greetz Boris
 
Back
Top