Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET
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.
Posted 28-Sep-12 19:38pm
Edited 28-Sep-12 19:48pm
Karthik Harve at 29-Sep-12 1:50am
What do you mean by authorised users ?
sasipriyakalpana at 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 at 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 at 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
0 Sergey Alexandrovich Kryukov 353
1 OriginalGriff 304
2 George Jonsson 258
3 Shemeemsha RA 138
4 Animesh Datta 130
0 OriginalGriff 5,985
1 Sergey Alexandrovich Kryukov 5,341
2 CPallini 4,760
3 George Jonsson 3,400
4 Gihan Liyanage 2,522

Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 1 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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