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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Display a table

Display a table

Scheduled Pinned Locked Moved ASP.NET
html
2 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.
  • M Offline
    M Offline
    Mansi Arora
    wrote on last edited by
    #1

    I have created a dynamic table and i one of its td I want to give link for another table which is actually a html table created on aspx page. for (int i = 0; i < dt.Rows.Count; i++) { TableRow trRow = new TableRow(); TableCell tdCell = new TableCell(); TableCell tdCell1 = new TableCell(); string user = dt.Rows[i]["username"].ToString(); tdCell.Text += "<td align='left'><a href='#' class='descriptiontext'>'" + dt.Rows[i]["username"].ToString() + "'</a></td>"; tdCell1.Text += "<td align='left'>'" + dt.Rows[0]["reason"].ToString() + "'</td>" ; trRow.Controls.Add(tdCell); trRow.Controls.Add(tdCell1); RecipientTable.Controls.Add(trRow); } plcUserMessage.Controls.Add(RecipientTable); } } public void FetchSenderMessage(string UserName) { string strSwapEmp, strSwapDate, strSwapReason; DataTable dt = monthdetail.MessageFromEmp(UserName); pnlRequestApproval.GroupingText = dt.Rows[0]["username"].ToString(); pnlRequestApproval.Controls.Add(tblAdmin); strSwapEmp = dt.Rows[0]["swap_candidate"].ToString(); strSwapReason = dt.Rows[0]["swap_reason"].ToString(); strSwapDate = dt.Rows[0]["swapping_date"].ToString(); lblDate.Text = strSwapDate; ddlUser.Text = strSwapEmp; txtUReason.Text = strSwapReason; } I want to call FetchSenderMessage(user) function on anchor tag hreference

    A 1 Reply Last reply
    0
    • M Mansi Arora

      I have created a dynamic table and i one of its td I want to give link for another table which is actually a html table created on aspx page. for (int i = 0; i < dt.Rows.Count; i++) { TableRow trRow = new TableRow(); TableCell tdCell = new TableCell(); TableCell tdCell1 = new TableCell(); string user = dt.Rows[i]["username"].ToString(); tdCell.Text += "<td align='left'><a href='#' class='descriptiontext'>'" + dt.Rows[i]["username"].ToString() + "'</a></td>"; tdCell1.Text += "<td align='left'>'" + dt.Rows[0]["reason"].ToString() + "'</td>" ; trRow.Controls.Add(tdCell); trRow.Controls.Add(tdCell1); RecipientTable.Controls.Add(trRow); } plcUserMessage.Controls.Add(RecipientTable); } } public void FetchSenderMessage(string UserName) { string strSwapEmp, strSwapDate, strSwapReason; DataTable dt = monthdetail.MessageFromEmp(UserName); pnlRequestApproval.GroupingText = dt.Rows[0]["username"].ToString(); pnlRequestApproval.Controls.Add(tblAdmin); strSwapEmp = dt.Rows[0]["swap_candidate"].ToString(); strSwapReason = dt.Rows[0]["swap_reason"].ToString(); strSwapDate = dt.Rows[0]["swapping_date"].ToString(); lblDate.Text = strSwapDate; ddlUser.Text = strSwapEmp; txtUReason.Text = strSwapReason; } I want to call FetchSenderMessage(user) function on anchor tag hreference

      A Offline
      A Offline
      Anurag Gandhi
      wrote on last edited by
      #2

      Mansi Arora wrote:

      I want to call FetchSenderMessage(user) function on anchor tag hreference

      <a href="#" onclick="javascript:return MyFunction();">Click Me</a>

      Don't forget to return false from the MyFunction() to avoid postback(or default behaviour). Is this the one you wanted?

      Anurag Gandhi.
      http://www.gandhisoft.com
      Life is a computer program and every one is the programmer of his own life.

      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