Links in Placeholder
-
I have a web page. This page contains a PlaceHolder and this placeholder brings or holds some links created by the admin at runtime. Not when we design the page i mean there is no exact no. of the links to be created by the admin. Let an admin create Four links like Jan,Feb,Mar,Apr..... Now i want as the client clicks on Jan link then a panel or imageButton should display the image of month Jan and if he/she clicks on Feb link then image of Feb month should display
-
I have a web page. This page contains a PlaceHolder and this placeholder brings or holds some links created by the admin at runtime. Not when we design the page i mean there is no exact no. of the links to be created by the admin. Let an admin create Four links like Jan,Feb,Mar,Apr..... Now i want as the client clicks on Jan link then a panel or imageButton should display the image of month Jan and if he/she clicks on Feb link then image of Feb month should display
Write a common event handler like private void linkmonth_Click(object sender, EventArgs e).. Now attach this eventhandler to the created links at runtime... link1.Click += new EventHandler(linkmonth_Click); link2.Click += new EventHandler(linkmonth_Click); link3.Click += new EventHandler(linkmonth_Click); ......and so on... Now in the event handler linkmonth_click, based on the sender object load the appropriate image and display... Here at runtime the admin should add linkbutton instead of Html tag... -- modified at 7:38 Monday 22nd October, 2007
Koushik
-
I have a web page. This page contains a PlaceHolder and this placeholder brings or holds some links created by the admin at runtime. Not when we design the page i mean there is no exact no. of the links to be created by the admin. Let an admin create Four links like Jan,Feb,Mar,Apr..... Now i want as the client clicks on Jan link then a panel or imageButton should display the image of month Jan and if he/she clicks on Feb link then image of Feb month should display
-
Write a common event handler like private void linkmonth_Click(object sender, EventArgs e).. Now attach this eventhandler to the created links at runtime... link1.Click += new EventHandler(linkmonth_Click); link2.Click += new EventHandler(linkmonth_Click); link3.Click += new EventHandler(linkmonth_Click); ......and so on... Now in the event handler linkmonth_click, based on the sender object load the appropriate image and display... Here at runtime the admin should add linkbutton instead of Html tag... -- modified at 7:38 Monday 22nd October, 2007
Koushik
First of All Thnx for ur solution but still i have a problem actually i'm having only one linkbutton for the all the links being created. Now problem is How it would be understood which link being clicked private void linkmonth_Click(object sender, EventArgs e) { Wht code i should write here when a link is clicked to display it's corresponding image } ================== Here below i'm putting my code plz try to understand on Page Load call createTable1() function public void createTable1() { Table table=new Table(); TableRow trRow; TableCell tcCell1=null; DataUtility dUT=new DataUtility(); string strsql="Select LinkName From AnmolTable Where Active=1"; DataTable dt=dUT.getDataTable(strsql); int total=Convert.ToInt32(dt.Rows.Count); for(int i=0;i<1;i++) { trRow=new TableRow(); //rowno=i+1; for(int j=0;j