Hi , i tried it ..
i can post my code here please do check ..and give me a solution
protected void Page_Load(object sender, EventArgs e)
{
//if (!this.IsPostBack)
//{
string Destination;
if (Request.QueryString["Destination"]==null)
{
Destination = "Alappuzha";
}
else
{
Destination = Request.QueryString["Destination"].ToString();
}
DataSet ds = Obj.DestinationDtls(Destination);
Lbl_Destination.Text = ds.Tables[0].Rows[0][0].ToString();
Image1.ImageUrl = "~//DestinationImages/" + ds.Tables[0].Rows[0][1].ToString();
Lbl_Content.Text = ds.Tables[0].Rows[0][2].ToString();
string strData = ds.Tables[0].Rows[0][3].ToString();
char[] separator = new char[] { ',' };
string[] strSplitArr = strData.Split(separator);
int arrlength = strSplitArr.Length;
foreach (string arrStr in strSplitArr )
{
//Here getting the indexvalue of array using indexof method
int i = Array.IndexOf(strSplitArr, arrStr);
// creating table row
TableRow tr = new TableRow();
//creating table cell
TableCell td = new TableCell();
//adding style to td
td.CssClass = "RelatedDestination";
LinkButton lnkBtn = new LinkButton();
lnkBtn.ID = "Lbtn_RelatedDest" + i.ToString();
//id = lnkBtn.ID;
lnkBtn.Text = arrStr;
lnkBtn.CommandName = arrStr.ToString();
lnkBtn.Click += new EventHandler(myFunction);
td.Controls.Add(lnkBtn);
tr.Cells.Add(td);
Table1.Rows.Add(tr);
div1.Controls.Add(Table1);
//i++;
}
//}
}
"Personality has the power to open many doors, but character must keep them open"
Shijohnjoseph, if this helps please login to Mark As Answer. | Alert Moderator