Passing a parameter to a User Control,

Posted by vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 339
Create a User Control and add below image control inside User Control as:-

<asp:ImageButton id="ImageButton1" runat="server"></asp:ImageButton> 

Create a property called source:-

public string source   
return ImageButton1.ImageUrl;
ImageButton1.ImageUrl = value;

Now in our webform:
Drag and drop User Control and set the source property as:-

<uc1:UCImageButton source = "view.jpg" Id = "UCImageButton1" 
runat = "server"></uc1:UCImageButton>

Comments or Responses

Login to post response