|
|
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);
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()
{
}
</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;
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;
}
}
|
|
|
|
|
Hi,
That would work for the client side part of the problem, but I assume they'll need to access the values entered into the new row from ASP.Net and that means a server side control needs to be created and persisted for each new textbox.
|
|
|
|
|
Martin Jarvis wrote: they'll need to access the values entered into the new row from ASP.Net and that means a server side control needs to be created and persisted
Wrong.Consider this brief example of accessing the value of
javascript generated form element for which no server side
control is created nor persisted.
<%@ 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 runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
init = function(){
for(i=0;i<3;i++){
frm = document.forms[0];
rdobt = document.createElement("INPUT");
rdobt.type = "RADIO"
rdobt.name = "radio"
rdobt.id = "rdobt1"
rdobt.value = i
frm.appendChild(rdobt)
}
}
</script>
</head>
<body onload="init()">
<form id="form1" runat="server">
<div>
<input type="submit" />
</div>
</form>
</body>
</html>
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(IsPostBack){
Response.Write(Request["radio"]);
}
}
}
|
|
|
|
|
Yes, you can directly create the html controls and pick the values out of the form variables. But in the original example, it clearly shows ASP.NET controls with associated server side events within the table row to create.
Using the ASP.Net server controls to persist viewstate and handle the various events would save a lot of roll-your-own code.
|
|
|
|
|
Hello friends,
I am using window.open function in order to display the page. The page pop up but fixed params i.e. height & width. However i want that it will be resizable as per the content of the page following is the code
window.open("EmpSubCert.aspx?Request_ID=" + requestId, "attendee_popup", 'left=400,top=400,resizable=no,scrollbars=no,height=150,width=500,toolbars=no,titlebar=no');
which param i ll add in the above code such that the pop up window display entire content of the page..
modified on Wednesday, April 14, 2010 10:14 AM
|
|
|
|
|
Hi there,
use resizable=yes to make your popup resizable.
For additional information on how to size/presize your popup see here for example.
|
|
|
|
|
I want to resize the pop up window as per the content of the page means the window will auto resize as per the content. However the resizble property can be used to set the window resizable by the user/client.
Please give me suggestion....
|
|
|
|
|
sandympatil wrote: Please give me suggestion....
Ok, I suggest you add an javascript to determine
the hieght and width of the document then set
the window size acordingly.
|
|
|
|
|
but how to determine the size of document content that pop ups
|
|
|
|
|
Maybe put a div around your content as container and use
document.getElementById('contentdiv').offsetWidth
document.getElementById('contentdiv').offsetHeight
in your javascript to get the size? Then resize your popup like
mentioned in the link i gave you earlier.
Hope this help a bit
|
|
|
|
|
Hi all,
in our production machine we hav 64 bit server with default aspnet 2.0 on IIS.
we have one application developed in 32 bit aspnet 1.1, the same we configured in IIS.
but in our aspnet 1.1 application we hav used read only property for some of the fields which works fine
in aspnet 1.1 with 32 bit machine but here in 64 bit aspnet 2.0 it doesnot work.
pls suggest me wht to do. any help will be appreciated.
Regards
Surender
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
There must be something else wrong with the application or your deployment. A read-only property will function the same in any version of the framework
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks mark for the reply.
There is a behavior difference between ASP.NET 1.1 and 2.0: If you have a control on a page that is marked Read-Only and EnableViewState is set to false on the Page, the ReadOnly value will no longer post back in ASP.NET 2.0 - the value gets lost. This even though the value is actually returned in the POST buffer.
But if you run the same with aspnet 1.1 it works fine.
Any help would be appreciated.
regards
surender
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
Don't you think it would have been important to include these details in the original post? You first only said a property, no mention of a control and postback.
However, since you have already quoted this[^] site, then implement the fix.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks for the reply Mark.
I hav gone through that link before here my concern is i do not want to change the Application code to fix the issue, bt i want that application to be run on aspnet 1.1 mode, how i can achieve this on 64 bit machine.
regards,
surender
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
surender.m wrote: i do not want to change the Application code to fix the issue
Then wait for Microsoft to fix the issue, though I suspect hell will freeze over long before that.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Mark,
I had changed my Application code, now its working fine.
Is there a way to run both aspnet 1.1 and aspnet 2.0 on IIS of a 64 bit machine?
Regards,
surender
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
The two frameworks can run side by side. You can use IIS to specifiy which version handles requests for a particular web application.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i have 2 columns in dataview, i want to populate MSChart with Type as StackedColumn and both columns on one over another.
|
|
|
|
|
Hi,
This is from Chandrakanth.
i have one problem with update panel in Ajax
in aspx page div tag is there. In that some controls are there.
i kept that div tag in the Update Panel to avoid post back by Asp:Image button click event.
I am using Asp:ImageButton. When i click on that image button client side code that is Javascript code should work as well as c# code should works.
problem is when i click on that Asp:ImageButton, post back is happening for DIV Tag. I want to avoid that post back of DIV tag. How can i avoid that.
<asp:imagebutton id="imgbutton" runat="server" onclick="GetLinkButtonTest"
onclientclick="javascript: SwitchMenus();"
imageurl="~/images/green_globe_refresh_601.jpg" height="32px"
width="31px">
Please help me out from this problem.
Thanks and Regards
Chandrakanth
|
|
|
|
|
OnClientClick='javascript: SwitchMenus(); return false;'
|
|
|
|
|
Hi,
Once again from Chandrakanth. if i use that code , Only Javascript code is working.But C# code is not working which was mention on onclick event.
any suggestions for this.
Thanks and Regards
Chandrakanth
|
|
|
|
|
I'm understanding that you have an imagebutton and a
div with some other controls within an updatepanel.
When you click your imagebutton, you want client and server-side
code to run but not update the contents of your updatepanel?
First, set the updatemode of your updatepanel to "conditional".
then, either place the imagebutton outside that panel (maybe into another updatepanel) or add this to your update-panel-markup:
ChildrenAsTriggers="false"
This prevents the updatepanel from updating its content if the imagebutton is clicked.
If you set ChildrenAsTriggers="false" , you can still add specific
triggers to the triggers-section of the updatepanel-markup.
Use UpdatePanelName.Update() to update the contents from server-side.
Good Luck
|
|
|
|
|
Hi,
Once again from Chandrakanth.
Thanks for prompt reply.
Problem is when i click on Image button, CLIENT SIDE CODE is executing, next POST BACK is happening, C# CODE is executing.
Actually my problem is i want to avoid that POST BACK when i click on ASP:IMAGE BUTTON.
Any suggestion please............
Thanks and Regards
Chandrakanth
|
|
|
|