[ ganjaman @ 01.02.2008. 07:52 ] @
... kojih inace ima 52 i kad pritisnem dugme koje izvrsi nekoimeDataSource.Insert() podaci se insertuju ali polja ostanu popunjena. Ako je potrebno i ovo da napisem, da sam wizardom konfigurisao DataSource i chekirao insert, update i delete pa je on sve generisao, a onda sam u njegovom properti-u klick na InserQuery definisao inpute i to je to. Ako treba i primer cu da zakacim. Hvala




[ barneymdx @ 01.02.2008. 09:25 ] @
upotrebi ovu funkciju...

public static Control[] GetAllControls(Control controlHolder)
{
List<Control> lc = new List<Control>();
foreach (Control c in controlHolder.Controls)
{
lc.Add(c);
if (c.HasControls())
{
lc.AddRange(GetControlsRecursive(c));
}
}
return lc.ToArray();
}

i pozovi je...

foreach (Control c in GetAllControls(Page))
{
if(c is TextBox)
((TextBox)c).Text=string.Empty;
}
[ ganjaman @ 01.02.2008. 10:01 ] @
Dobijam gresku
Code:

Server Error in '/ucenje1CS' Application.
--------------------------------------------------------------------------------

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 


Compiler Error Message: CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

 

Line 4:      public static Control[] GetAllControls(Control controlHolder)
Line 5:      {
Line 6:          List<Control> lc = new List<Control>();
Line 7:      foreach (Control c in controlHolder.Controls)
Line 8:      {


Ako ti nije tesko i imas vremena mozes da implementiras kod u ovu moju probu da vidim kako to radi.

EDIT: Uploadovao sam uz prethodnu nisam vido scroller. Hm sta reci desi se :)
[ aleksandarpopov @ 01.02.2008. 10:07 ] @
Dodaj u using listu System.Collections.Generic
[ ganjaman @ 01.02.2008. 10:52 ] @
Sad ovo
Code:

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0103: The name 'GetControlsRecursive' does not exist in the current context

Source Error:

 

Line 21:             if (c.HasControls())
Line 22:             {
Line 23:                 lc.AddRange(GetControlsRecursive(c));
Line 24:             }
Line 25:         }
 
 


Sta mu je sad..
Da ne smaram previse ako bi ste mi rekli kako se to "blankovanje" zove u IT recniku pa cu da googlam jer ne umem dobro da postavim upit dodjavola.
[ aleksandarpopov @ 01.02.2008. 12:25 ] @
Dodaj novi metod koji ces pozvati nakon tvog inserta. Kod za metod ti je recimo ovako nesto :
Code:

        foreach (Control pc in Page.Controls)
        {
            foreach (Control ctrl in pc.Controls)
            {
                if (ctrl is TextBox) 
                    (ctrl as TextBox).Text = "";
            }
        }
[ ganjaman @ 01.02.2008. 12:47 ] @
Hvala gospodo na trudu evo naso sam tacno ono sto mi je trebalo, a sto je najvaznije umem da ga modifikujem. Evo kako
http://www.dotnetcurry.com/Sho...;AspxAutoDetectCookieSupport=1