Private sub DoSomething()
'
'Create control
'
Dim lbDemo As New LinkButton
'
'Modify properties
'
lbDemo.Text = "Click me!"
lbDemo.Visible = True
'
'Add a handler for the click event
'
AddHandler lbDemo.Click, AddressOf LinkButton_Clicked
'
'Add the new control to the page, panel, placeholder, whatever...
'
Page.Controls.Add(lbDemo)
End Sub
Private Sub LinkButton_Clicked(ByVal sender As Object, ByVal e As System.EventArgs)
'
'Gets called when our custom linkbutton is clicked
'
End Sub
FYI: A LinkButton must be inside of a Form where Runat=Server.
Good Luck, Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0 *I do not follow all threads, so if you have a secondary question, message me.
i already tryied this method but its return the following error.
Code:
Server Error in '/CI' Application.
--------------------------------------------------------------------------------
Control '_ctl0' of type 'LinkButton' must be placed inside a form tag with runat=server.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Control '_ctl0' of type 'LinkButton' must be placed inside a form tag with runat=server.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Control '_ctl0' of type 'LinkButton' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Control control)
System.Web.UI.WebControls.LinkButton.AddAttributesToRender(HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Originally Posted by Craig Gemmill
Code:
Private sub DoSomething()
'
'Create control
'
Dim lbDemo As New LinkButton
'
'Modify properties
'
lbDemo.Text = "Click me!"
lbDemo.Visible = True
'
'Add a handler for the click event
'
AddHandler lbDemo.Click, AddressOf LinkButton_Clicked
'
'Add the new control to the page, panel, placeholder, whatever...
'
Page.Controls.Add(lbDemo)
End Sub
Private Sub LinkButton_Clicked(ByVal sender As Object, ByVal e As System.EventArgs)
'
'Gets called when our custom linkbutton is clicked
'
End Sub
FYI: A LinkButton must be inside of a Form where Runat=Server.
Please avoid sending emails to my personal mail:
write your doubts as thread in Codeguru
Crystal Reports Forum.
This will help all people having similar matters, and will let people who know solutions on the specific topic
share their knowledge.
Yes... again, it has to be inside of a FORM where RUNAT=SERVER.
I've attached an example that shows one method to place a control in the middle of a FORM.
Good Luck, Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0 *I do not follow all threads, so if you have a secondary question, message me.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.