Can i send server control from aspx.cs page

can i send server control from aspx.cs page

0


a source to share


3 answers


If "send" means "create", you can do this easily by adding a dynamically created control to a container such as a page or panel:

LinkButton lnk1 = new LinkButton();
// Set any required properties.
...

// Add the control to the container.
Panel1.Controls.Add(lnk1);

      



The LinkButton will render to the client as expected.

+5


a source


add a label to your form

in your code behind the file [cs file]



label1.Text="<a href='your url'>LinkButton</a>";
      

0


a source


You do it directly.

Pages.Controls.Add (yourcontrolpathhere)

0


a source







All Articles