Hi,
I want to create hyperlink button at run time in Vb.Net->asp.net web application. eg. mywebapp.aspx.vb (VB coding)
I want to create hyperlink button through by vb coding, not by asp code.
Thanks a lot,
K.Babu
Hi,
I want to create hyperlink button at run time in Vb.Net->asp.net web application. eg. mywebapp.aspx.vb (VB coding)
I want to create hyperlink button through by vb coding, not by asp code.
Thanks a lot,
K.Babu
FYI: A LinkButton must be inside of a Form where Runat=Server.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
Hi,
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
Quote:
Originally Posted by Craig Gemmill
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.