Click here to Skip to main content
15,886,648 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

class.aspx code:

ASP.NET
<asp:ImageButton ID="Img1" ImageUrl='<%#Eval("ProductImage") %>' runat="server" Width="30px" Height="30px" OnClick="MakeImgMain" />



class.aspx.cs code:

C#
protected void MakeImgMain(object sender, EventArgs e)
        {
            string ID = ((ImageButton)sender).ID;
            string CLientID = ((ImageButton)sender).ClientID;
            string url = ((ImageButton)sender).ImageUrl;
            ChangeImageOnClick(url);
            UpdatePanel5.Update();
        }

        public void ChangeImageOnClick(string url)
        {
            string imageurl = url;
            Image selimg = ((Image)ProdDescDetails.Items[0].FindControl("Prodimage"));
           // selimg.ImageUrl = "";
            selimg.ImageUrl = imageurl;
        }


Onclick event works only for authorized user not for all users.
How to solve this.

Thanks in advance.
Posted
Updated 28-Sep-12 19:48pm
v2
Comments
Karthik Harve 29-Sep-12 1:50am    
What do you mean by authorised users ?
sasipriyakalpana 29-Sep-12 1:55am    
I am working on Onlinesupermarket project.The products are displayed in default page and when i click on one image it display the selected image details in another page.
when i login to the site then it works but as unkown user it wont display the information.
AmitGajjar 29-Sep-12 2:35am    
so what behavior you want ? when user login, site working. and when user not login site should not working. this is correct behavior.
sasipriyakalpana 29-Sep-12 2:47am    
I want that all users will have to see the products information with login as well as without login.

1 solution

Replace OnClick to
HTML
onclick


All the Best
Gopinath Natarajan
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900