Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. asp linkbutton in html

asp linkbutton in html

Scheduled Pinned Locked Moved ASP.NET
htmlsysadminquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    R Thomas 0
    wrote on last edited by
    #1

    hi..i am trying to get a asp:linkbutton in html table header linke this ~MyStringBuilder2~.AppendFormat~(~" <~th bgColor=""#f6a127""><~asp:LinkButton id=""LB1"" Text = ""Click Me"" OnClick = ""LB1_Click"" runat=""server""/~><~/th~>" + vbCrLf)(without the (~)) but i cant seem to get it.. the header is always blank/.... can someone pls tell me whats the prob??? tks "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

    J 1 Reply Last reply
    0
    • R R Thomas 0

      hi..i am trying to get a asp:linkbutton in html table header linke this ~MyStringBuilder2~.AppendFormat~(~" <~th bgColor=""#f6a127""><~asp:LinkButton id=""LB1"" Text = ""Click Me"" OnClick = ""LB1_Click"" runat=""server""/~><~/th~>" + vbCrLf)(without the (~)) but i cant seem to get it.. the header is always blank/.... can someone pls tell me whats the prob??? tks "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

      J Offline
      J Offline
      John Kuhn
      wrote on last edited by
      #2

      The "asp:LinkButton" tags for a LinkButton are a design-time HTML element for an ASP.NET page, and you cannot emit those tags into the HTML page and have them show up correctly; they are pre-processed by ASP.NET into the correct combination of JavaScript & HTML that will interact with the server during a post back. You can, however, dynamically add a new LinkButton to the controls collection of a container and that will render correctly. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

      R 1 Reply Last reply
      0
      • J John Kuhn

        The "asp:LinkButton" tags for a LinkButton are a design-time HTML element for an ASP.NET page, and you cannot emit those tags into the HTML page and have them show up correctly; they are pre-processed by ASP.NET into the correct combination of JavaScript & HTML that will interact with the server during a post back. You can, however, dynamically add a new LinkButton to the controls collection of a container and that will render correctly. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

        R Offline
        R Offline
        R Thomas 0
        wrote on last edited by
        #3

        i did...doesnt work either... Public Class HKFilmReport Inherits System.Web.UI.Page Public WithEvents myPlaceHolder As System.Web.UI.WebControls.PlaceHolder Public WithEvents myLinkBtn As System.Web.UI.WebControls.LinkButton #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Protected WithEvents lblOutput As System.Web.UI.WebControls.Label Protected WithEvents imgBtnBack As System.Web.UI.WebControls.ImageButton Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm Protected WithEvents lblHeading As System.Web.UI.WebControls.Label Protected WithEvents lblBy As System.Web.UI.WebControls.Label Protected WithEvents lblDate As System.Web.UI.WebControls.Label Protected initVal As Boolean Protected sortOrder As Integer Protected WithEvents ds As System.Web.UI.WebControls.LinkButton Protected WithEvents ph As System.Web.UI.WebControls.PlaceHolder 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not IsPostBack Then If Request.QueryString("action") = "sort" Then FillDataSet(1) Else FillDataSet() End If lblDate.Text = "Date : " & Date.Now lblBy.Text = "Generated by : " & Session.Item("userName") End If End Sub Private Sub FillDataSet(Optional ByVal sort As Integer = -1) Dim sqlStr As String Dim dataStr As String Dim bUsed As Boolean Dim objReport As New TETRAPAK.ReportClass Dim arrFilter As New ArrayList arrFilter = Session.Item("FilterArray") bUsed = False sqlStr = objReport.GetFields(5, Session.Item("FilterArray"), Session.Item("Filters"), Session.Item("Values"), bUsed, sort) myPlaceHolder = New PlaceHolder myLinkBtn = New LinkButton '

        J 1 Reply Last reply
        0
        • R R Thomas 0

          i did...doesnt work either... Public Class HKFilmReport Inherits System.Web.UI.Page Public WithEvents myPlaceHolder As System.Web.UI.WebControls.PlaceHolder Public WithEvents myLinkBtn As System.Web.UI.WebControls.LinkButton #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Protected WithEvents lblOutput As System.Web.UI.WebControls.Label Protected WithEvents imgBtnBack As System.Web.UI.WebControls.ImageButton Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm Protected WithEvents lblHeading As System.Web.UI.WebControls.Label Protected WithEvents lblBy As System.Web.UI.WebControls.Label Protected WithEvents lblDate As System.Web.UI.WebControls.Label Protected initVal As Boolean Protected sortOrder As Integer Protected WithEvents ds As System.Web.UI.WebControls.LinkButton Protected WithEvents ph As System.Web.UI.WebControls.PlaceHolder 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not IsPostBack Then If Request.QueryString("action") = "sort" Then FillDataSet(1) Else FillDataSet() End If lblDate.Text = "Date : " & Date.Now lblBy.Text = "Generated by : " & Session.Item("userName") End If End Sub Private Sub FillDataSet(Optional ByVal sort As Integer = -1) Dim sqlStr As String Dim dataStr As String Dim bUsed As Boolean Dim objReport As New TETRAPAK.ReportClass Dim arrFilter As New ArrayList arrFilter = Session.Item("FilterArray") bUsed = False sqlStr = objReport.GetFields(5, Session.Item("FilterArray"), Session.Item("Filters"), Session.Item("Values"), bUsed, sort) myPlaceHolder = New PlaceHolder myLinkBtn = New LinkButton '

          J Offline
          J Offline
          John Kuhn
          wrote on last edited by
          #4

          What is a TETRAPAK.ReportClass and why do you pass it myPlaceHolder as a method parameter? What does its documentation say about the allowable parameters and how those interact with the page? What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

          R 1 Reply Last reply
          0
          • J John Kuhn

            What is a TETRAPAK.ReportClass and why do you pass it myPlaceHolder as a method parameter? What does its documentation say about the allowable parameters and how those interact with the page? What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

            R Offline
            R Offline
            R Thomas 0
            wrote on last edited by
            #5

            i am trying to pass the placeholder cause while makein a html page.. i can put the place holder taht i pass inside the html.. i done understand what you mean by documentation... also dont understand your whole second question..:( "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

            J 1 Reply Last reply
            0
            • R R Thomas 0

              i am trying to pass the placeholder cause while makein a html page.. i can put the place holder taht i pass inside the html.. i done understand what you mean by documentation... also dont understand your whole second question..:( "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

              J Offline
              J Offline
              John Kuhn
              wrote on last edited by
              #6

              OK, here's your code:

              Public Class HKFilmReport
              Inherits System.Web.UI.Page

              Public WithEvents myPlaceHolder As System.Web.UI.WebControls.PlaceHolder
              Public WithEvents myLinkBtn As System.Web.UI.WebControls.LinkButton
              ' region omitted

              Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles MyBase.Load
              If Not IsPostBack Then
              If Request.QueryString("action") = "sort" Then
              FillDataSet(1)
              Else
              FillDataSet()
              End If
              lblDate.Text = "Date : " & Date.Now
              lblBy.Text = "Generated by : " & Session.Item("userName")
              End If
              End Sub

              Private Sub FillDataSet(Optional ByVal sort As Integer = -1)
              Dim sqlStr As String
              Dim dataStr As String
              Dim bUsed As Boolean
              Dim objReport As New TETRAPAK.ReportClass
              Dim arrFilter As New ArrayList
              arrFilter = Session.Item("FilterArray")
              bUsed = False
              sqlStr = objReport.GetFields(5, Session.Item("FilterArray"), Session.Item("Filters"), Session.Item("Values"), bUsed, sort)

              myPlaceHolder = New PlaceHolder
              myLinkBtn = New LinkButton
              myLinkBtn.ID = "lnkBtn"
              myLinkBtn.Text = "Status(Active/Inactive)"
              myLinkBtn.onclick = SortNow()
              myPlaceHolder.ID = "plcHolder"
              myPlaceHolder.Controls.Add(myLinkBtn)
              dataStr = objReport.RetrieveData(sqlStr, 5, bUsed, myPlaceHolder)
              lblOutput.Text = dataStr
              

              End Sub

              End Class

              What is the thing in bold? What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups