Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 09, 2012 06:12 PM by RameshRajendran
Member
480 Points
432 Posts
Jun 09, 2012 07:34 AM|LINK
I have 2 code but i want to make it one then how to write this here....
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ImageButton img1 = (ImageButton)e.Item.FindControl("lblfileupload"); string imgstr = ""; imgstr = img1.ImageUrl; imgstr = imgstr.Replace("../", ""); img1.ImageUrl = imgstr.ToString().TrimStart(); img1.Visible = true; ImageButton lblfileupload = (ImageButton)e.Item.FindControl("lblfileupload"); Label lblfileupload1 = (Label)e.Item.FindControl("lblfileupload1"); lblfileupload.Attributes.Add("onmouseout", "this.src = '" + lblfileupload.ImageUrl + "'"); lblfileupload1.Attributes.Add("onmouseover", "this.src = '" + lblfileupload1.Text + "'"); } }
260 Points
80 Posts
Jun 09, 2012 11:48 AM|LINK
your ques is not clear. what you want to ask about?
Star
12922 Points
2672 Posts
Jun 09, 2012 03:36 PM|LINK
where is your second code ?
7983 Points
2099 Posts
Jun 09, 2012 06:12 PM|LINK
u have use one imageButton for top and put if conditin..Then u will call the imagebutton object inside u r if and else condition's
majarajaking
Member
480 Points
432 Posts
How to write this ?
Jun 09, 2012 07:34 AM|LINK
I have 2 code but i want to make it one then how to write this here....
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ImageButton img1 = (ImageButton)e.Item.FindControl("lblfileupload"); string imgstr = ""; imgstr = img1.ImageUrl; imgstr = imgstr.Replace("../", ""); img1.ImageUrl = imgstr.ToString().TrimStart(); img1.Visible = true; ImageButton lblfileupload = (ImageButton)e.Item.FindControl("lblfileupload"); Label lblfileupload1 = (Label)e.Item.FindControl("lblfileupload1"); lblfileupload.Attributes.Add("onmouseout", "this.src = '" + lblfileupload.ImageUrl + "'"); lblfileupload1.Attributes.Add("onmouseover", "this.src = '" + lblfileupload1.Text + "'"); } }snh_algorith...
Member
260 Points
80 Posts
Re: How to write this ?
Jun 09, 2012 11:48 AM|LINK
your ques is not clear. what you want to ask about?
Ramesh Chand...
Star
12922 Points
2672 Posts
Re: How to write this ?
Jun 09, 2012 03:36 PM|LINK
where is your second code ?
RameshRajend...
Star
7983 Points
2099 Posts
Re: How to write this ?
Jun 09, 2012 06:12 PM|LINK
u have use one imageButton for top and put if conditin..Then u will call the imagebutton object inside u r if and else condition's