Click here to Skip to main content
15,906,574 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Current theme Pin
michaelschmitt15-Apr-10 8:00
michaelschmitt15-Apr-10 8:00 
GeneralRe: Current theme Pin
paper6715-Apr-10 8:01
paper6715-Apr-10 8:01 
GeneralRe: Current theme Pin
michaelschmitt15-Apr-10 8:23
michaelschmitt15-Apr-10 8:23 
QuestionAdd HTML table row at run time by clicking a button Pin
_______________________14-Apr-10 4:26
_______________________14-Apr-10 4:26 
AnswerRe: Add HTML table row at run time by clicking a button Pin
Martin Jarvis14-Apr-10 10:58
Martin Jarvis14-Apr-10 10:58 
GeneralRe: Add HTML table row at run time by clicking a button Pin
_______________________14-Apr-10 16:45
_______________________14-Apr-10 16:45 
GeneralRe: Add HTML table row at run time by clicking a button Pin
Martin Jarvis14-Apr-10 23:00
Martin Jarvis14-Apr-10 23:00 
AnswerRe: Add HTML table row at run time by clicking a button Pin
daveyerwin14-Apr-10 12:14
daveyerwin14-Apr-10 12:14 
You were close to getting it right.I made some minor
changes to make it work. Consider this code ...

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" >

 <head id="Head1" runat="server"> 
 <title>Portfolio Management System</title> 
 <script language="javascript" type="text/javascript"> 

function AddRow()
{
var table = document.getElementById("tblGrid");
if (!table) throw "Table not found";
var row = table.insertRow(-1); 

//append at the end
var cell1 = row.insertCell(-1);
var cell2 = row.insertCell(-1);
var cell3 = row.insertCell(-1);

cell1.innerHTML = "<input type='text' id='div_no'>";
cell2.innerHTML = "<input type='text' id='txt_divdate'> <img src='images/calendar.gif' onclick='caldisplay'>";
cell3.innerHTML = "<input type='text' id='txt_divunits'>";


}

function caldisplay()
{
//var dt=document.getElementById('Calendar1');
//dt.style.display='block';


}

</script> </head>
<body> 
<form id="frm_dividend_hist" runat="server"> 
 <table id="tblGrid" style="table-layout:fixed; z-index: 107; left: 125px; position: absolute; top: 216px;" border="1" bordercolor="#3399ff" width="270"> 
   <tr> 
    <td style="height: 19px; width: 70px;"> 
     Dividend #
    </td> 
    <td style="height: 19px; width: 120px;">
      Dividend Date
    </td> 
    <td style="height: 19px; width: 80px;">
     % Units
    </td> 
  </tr> 
  <tr> 
   <td style="width: 158px; height: 13px">
    <asp:TextBox ID="div_no" runat="server" Style="z-index: 100; left: 4px; position: absolute;
top: 29px" Width="57px" Height="13px">
    </asp:TextBox> 
   </td> 
   <td style="height: 13px; width: 330px;"> 
    <asp:TextBox ID="txt_divdate" runat="server" Style="z-index: 100; left: 80px; position: absolute;
top: 31px" Width="91px" Height="10px">
    </asp:TextBox> 
    <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/calendar.gif" Style="z-index: 105; left: 182px; position: absolute;
top: 30px" OnClick="ImageButton2_Click1" /> 
   </td> 
   <td style="width: 50px; height: 19px"> 
    <asp:TextBox ID="txt_divunits" runat="server" Style="z-index: 102;
left: 217px; position: absolute; top: 29px" Width="17px">
    </asp:TextBox> 
    <input type="button" ID="Button1" Style="z-index: 108; left: 250px; position: absolute;
top: 29px" Text="+" Width="27px" OnClick="AddRow()" Height="20px" /> 
   </td> 
  </tr> 
 </table> 
</form> </table> <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" Style="z-index: 105; left: 674px; position: absolute;
top: 263px" Visible="False" Width="200px" OnSelectionChanged="Calendar1_SelectionChanged"> <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" /> <SelectorStyle BackColor="#CCCCCC" /> <WeekendDayStyle BackColor="#FFFFCC" /> <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" /> <OtherMonthDayStyle ForeColor="#808080" /> <NextPrevStyle VerticalAlign="Bottom" /> <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" /> <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" /> </asp:Calendar> </body> </html> 



using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
//using Logic;

public partial class _Default : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {


    }

    protected void ImageButton2_Click1(object sender, ImageClickEventArgs e)
    {
        Calendar1.Visible = true;
    }
    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        this.txt_divdate.Text = Calendar1.SelectedDate.ToString("d");
        Calendar1.Visible = false;

    }

   // protected void Button1_Click(object sender, EventArgs e)
   // {

   //     this.Button1.Attributes.Add("onclick", "AddRow()");
   // }
}

GeneralRe: Add HTML table row at run time by clicking a button Pin
Martin Jarvis14-Apr-10 23:02
Martin Jarvis14-Apr-10 23:02 
GeneralRe: Add HTML table row at run time by clicking a button Pin
daveyerwin15-Apr-10 1:18
daveyerwin15-Apr-10 1:18 
GeneralRe: Add HTML table row at run time by clicking a button Pin
Martin Jarvis15-Apr-10 1:26
Martin Jarvis15-Apr-10 1:26 
Questionwindow.open The Pop window can be resize as per the content of the page Pin
Sandesh M Patil14-Apr-10 4:02
Sandesh M Patil14-Apr-10 4:02 
AnswerRe: window.open The Pop window can be resize as per the content of the page Pin
michaelschmitt14-Apr-10 5:38
michaelschmitt14-Apr-10 5:38 
GeneralRe: window.open The Pop window can be resize as per the content of the page Pin
Sandesh M Patil14-Apr-10 6:14
Sandesh M Patil14-Apr-10 6:14 
GeneralRe: window.open The Pop window can be resize as per the content of the page Pin
daveyerwin14-Apr-10 7:05
daveyerwin14-Apr-10 7:05 
GeneralRe: window.open The Pop window can be resize as per the content of the page Pin
Sandesh M Patil14-Apr-10 22:33
Sandesh M Patil14-Apr-10 22:33 
GeneralRe: window.open The Pop window can be resize as per the content of the page Pin
michaelschmitt14-Apr-10 23:31
michaelschmitt14-Apr-10 23:31 
QuestionHow to Run 32 bit aspnet 1.1 applications on 64 bit machine. Pin
surender.m14-Apr-10 2:19
surender.m14-Apr-10 2:19 
AnswerRe: How to Run 32 bit aspnet 1.1 applications on 64 bit machine. Pin
Not Active14-Apr-10 2:32
mentorNot Active14-Apr-10 2:32 
GeneralRe: How to Run 32 bit aspnet 1.1 applications on 64 bit machine. Pin
surender.m14-Apr-10 3:05
surender.m14-Apr-10 3:05 
GeneralRe: How to Run 32 bit aspnet 1.1 applications on 64 bit machine. Pin
Not Active14-Apr-10 3:36
mentorNot Active14-Apr-10 3:36 
GeneralRe: How to Run 32 bit aspnet 1.1 applications on 64 bit machine. Pin
surender.m14-Apr-10 18:10
surender.m14-Apr-10 18:10 
GeneralRe: How to Run 32 bit aspnet 1.1 applications on 64 bit machine. Pin
Not Active14-Apr-10 20:42
mentorNot Active14-Apr-10 20:42 
GeneralRe: How to Run 32 bit aspnet 1.1 applications on 64 bit machine. Pin
surender.m14-Apr-10 20:48
surender.m14-Apr-10 20:48 
GeneralRe: How to Run 32 bit aspnet 1.1 applications on 64 bit machine. Pin
Not Active15-Apr-10 1:58
mentorNot Active15-Apr-10 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.