Click here to Skip to main content
15,892,298 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Firing pf Application event Pin
kubben31-Jul-07 5:52
kubben31-Jul-07 5:52 
GeneralRe: Firing pf Application event Pin
ramdil1-Aug-07 0:20
ramdil1-Aug-07 0:20 
QuestionProblem when i try to run my application Pin
Assaf8227-Jul-07 4:32
Assaf8227-Jul-07 4:32 
AnswerRe: Problem when i try to run my application Pin
szukuro27-Jul-07 4:53
szukuro27-Jul-07 4:53 
QuestionFileUpload Control Pin
Civic0627-Jul-07 3:59
Civic0627-Jul-07 3:59 
AnswerRe: FileUpload Control Pin
szukuro27-Jul-07 4:27
szukuro27-Jul-07 4:27 
GeneralRe: FileUpload Control Pin
Civic0627-Jul-07 5:22
Civic0627-Jul-07 5:22 
Questionproblem with maintaining value of dynamic control Pin
imranafsari27-Jul-07 3:52
imranafsari27-Jul-07 3:52 
hi all ,

i am mess with the one situation.

i am using asp.net2.0 ,C# and sql server 2005.

i have checkboxlist and based on user selection i creates dynamic controls(which code is in filterbutton_Click event and i call createcontrols function(public) in that ). but when i select value of that control(dynamic created) in another button click event(searchbutton) first it create fuction does not create dynamic control second as a result i do not get value of the control i call create function in filterbutton click and oninit()
please help

my create function is



private void createcontrols()

{

i = 1;

//if (CheckBoxListmst.SelectedIndex > -1)

//{

foreach (ListItem li in CheckBoxListmst.Items)

{

if (li.Selected == true)

{

Label label = new Label();

DropDownList dropdownlist = new DropDownList();

label.ID = "label" + i.ToString();

label.EnableViewState = true;

dropdownlist.ID = "dropdownlist" + i.ToString();

dropdownlist.EnableViewState = true ;


label.Text = li.Text;

//Label1.Text += dropdownlist.ID ;

i++;

//rdr = cmd.ExecuteReader();

for (int j = 0; j < 5; j++ )

{

ListItem ld = new ListItem();

ld.Text = j.ToString() ;

ld.Value = j.ToString();

dropdownlist.Items.Add(ld);



}

PlaceHolder1.Controls.Add(label);

PlaceHolder1.Controls.Add(dropdownlist);



Response.Write("
");


}

}

}

// }

}



and i access it with the code as

Label objlbl;

DropDownList objdrop;

objlbl = this.PlaceHolder1.FindControl("label1") as Label;

objdrop = this.PlaceHolder1.FindControl("dropdownlist1") as DropDownList;

if ((objlbl != null) && (objdrop.SelectedIndex > -1 ))

{

Label1.Text = objlbl.Text; //Page.FindControl("label1").ToString() ;

Label2.Text = objdrop.SelectedValue;

}





i call createcontrol funtion in filterbutton_click and override oninit()


imaran khan

AnswerRe: problem with maintaining value of dynamic control Pin
wk63327-Jul-07 6:23
wk63327-Jul-07 6:23 
GeneralRe: problem with maintaining value of dynamic control Pin
imranafsari27-Jul-07 23:04
imranafsari27-Jul-07 23:04 
GeneralRe: problem with maintaining value of dynamic control Pin
wk63328-Jul-07 6:26
wk63328-Jul-07 6:26 
QuestionOne more problem in Timer Pin
Balagurunathan S27-Jul-07 2:34
Balagurunathan S27-Jul-07 2:34 
AnswerRe: One more problem in Timer Pin
Manuel F. Hernandez27-Jul-07 4:12
Manuel F. Hernandez27-Jul-07 4:12 
GeneralRe: One more problem in Timer Pin
Balagurunathan S27-Jul-07 20:04
Balagurunathan S27-Jul-07 20:04 
AnswerRe: One more problem in Timer Pin
Guffa27-Jul-07 5:03
Guffa27-Jul-07 5:03 
GeneralRe: One more problem in Timer Pin
Balagurunathan S27-Jul-07 20:01
Balagurunathan S27-Jul-07 20:01 
AnswerRe: One more problem in Timer Pin
Guffa27-Jul-07 20:51
Guffa27-Jul-07 20:51 
QuestionGLOBAL ASSEMBLY CACHE Pin
Sonia Gupta27-Jul-07 2:18
Sonia Gupta27-Jul-07 2:18 
AnswerRe: GLOBAL ASSEMBLY CACHE Pin
Piyush Vardhan Singh27-Jul-07 2:55
Piyush Vardhan Singh27-Jul-07 2:55 
AnswerRe: GLOBAL ASSEMBLY CACHE Pin
Piyush Vardhan Singh27-Jul-07 3:08
Piyush Vardhan Singh27-Jul-07 3:08 
Questionproblem in Timer.. Pin
Balagurunathan S27-Jul-07 2:16
Balagurunathan S27-Jul-07 2:16 
AnswerRe: problem in Timer.. Pin
Manuel F. Hernandez27-Jul-07 4:13
Manuel F. Hernandez27-Jul-07 4:13 
QuestionNeed javascript to avoid copy paste in a text box Pin
Balagurunathan S27-Jul-07 2:11
Balagurunathan S27-Jul-07 2:11 
AnswerRe: Need javascript to avoid copy paste in a text box Pin
wEb GuRu...27-Jul-07 4:23
wEb GuRu...27-Jul-07 4:23 
Questionproblem with updating records from datagrid Pin
ooooooooppppppss27-Jul-07 1:22
ooooooooppppppss27-Jul-07 1:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.