Click here to Skip to main content
14,105,677 members
Rate this:
Please Sign up or sign in to vote.
See more:

class.aspx code:

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

class.aspx.cs code:

protected void MakeImgMain(object sender, EventArgs e)
            string ID = ((ImageButton)sender).ID;
            string CLientID = ((ImageButton)sender).ClientID;
            string url = ((ImageButton)sender).ImageUrl;

        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.
Updated 28-Sep-12 19:48pm
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Replace OnClick to

All the Best
Gopinath Natarajan

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190518.1 | Last Updated 1 Oct 2012
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100