Saturday, March 31, 2012
Table Rows
I can only add one row to a Table control. Is there a property that
restricts adding multiple rows? I've tried several different ways.
I've gotten to the point where I can add the information I need for
the second row but it only replaces the original info from the first
row, resulting in still only one row.
ThanksHow exactly are you trying to do this, in code, based on populating from
database?
(show us how you're trying to do it)
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"Looch" <lucianoj2005@.yahoo.com> wrote in message
news:22db0303-349e-4e5e-a6f9-003c3cde7333@.62g2000hsn.googlegroups.com...
> All,
> I can only add one row to a Table control. Is there a property that
> restricts adding multiple rows? I've tried several different ways.
> I've gotten to the point where I can add the information I need for
> the second row but it only replaces the original info from the first
> row, resulting in still only one row.
> Thanks
Here's the code I'm using, the 'else' statement below never gets ran
regardlesss how many times the cmdAdd button is clicked.
protected void Page_Load(object sender, EventArgs e)
{
ddlQuantity.Items.Clear();
ddlItem.Items.Clear();
ddlQuantity.Items.Add("1");
ddlQuantity.Items.Add("2");
ddlQuantity.Items.Add("3");
ddlQuantity.Items.Add("4");
ddlItem.Items.Add("Test");
ddlItem.Items.Add("Test2");
Session.Add("RowCount", (int)ItemTable.Rows.Count);
}
protected void cmdAdd_Click(object sender, EventArgs e)
{
if (Convert.ToInt32(Session["RowCount"]) == 0) //For the first
time cmdAdd is clicked
{
row.ID = "row" + ItemTable.Rows.Count.ToString();
cell.Width = 343;
cell.ID = "cell" + ItemTable.Rows.Count.ToString();
cell2.Width = 125;
cell2.ID = "cell2" + ItemTable.Rows.Count.ToString();
cell2.HorizontalAlign = HorizontalAlign.Center;
ItemTable.Rows.Add(row);
row.Cells.Add(cell);
row.Cells.Add(cell2);
ItemTable.Rows[0].Cells[0].Text = ddlItem.Text;
ItemTable.Rows[0].Cells[1].Text = ddlQuantity.Text;
ItemsToOrder items = new ItemsToOrder();
items.ItemName = ddlItem.Text;
items.Quantity = ddlQuantity.Text;
Session.Add("ItemOrder", items);
Session["RowCount"] = ItemTable.Rows.Count;
}
else //For every other time the button is clicked
{
txtPendingShip.Text = "Test";
}
}
Is there any reason you would need to rebuild the items in the dropdownlist
on every postback, and not surround it with an if/then/postback block?
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"Looch" <lucianoj2005@.yahoo.com> wrote in message
news:d55f2313-88be-4980-83ab-b43430b9b674@.62g2000hsn.googlegroups.com...
> Here's the code I'm using, the 'else' statement below never gets ran
> regardlesss how many times the cmdAdd button is clicked.
> protected void Page_Load(object sender, EventArgs e)
> {
> ddlQuantity.Items.Clear();
> ddlItem.Items.Clear();
> ddlQuantity.Items.Add("1");
> ddlQuantity.Items.Add("2");
> ddlQuantity.Items.Add("3");
> ddlQuantity.Items.Add("4");
> ddlItem.Items.Add("Test");
> ddlItem.Items.Add("Test2");
> Session.Add("RowCount", (int)ItemTable.Rows.Count);
> }
> protected void cmdAdd_Click(object sender, EventArgs e)
> {
> if (Convert.ToInt32(Session["RowCount"]) == 0) //For the first
> time cmdAdd is clicked
> {
> row.ID = "row" + ItemTable.Rows.Count.ToString();
> cell.Width = 343;
> cell.ID = "cell" + ItemTable.Rows.Count.ToString();
> cell2.Width = 125;
> cell2.ID = "cell2" + ItemTable.Rows.Count.ToString();
> cell2.HorizontalAlign = HorizontalAlign.Center;
> ItemTable.Rows.Add(row);
> row.Cells.Add(cell);
> row.Cells.Add(cell2);
> ItemTable.Rows[0].Cells[0].Text = ddlItem.Text;
> ItemTable.Rows[0].Cells[1].Text = ddlQuantity.Text;
> ItemsToOrder items = new ItemsToOrder();
> items.ItemName = ddlItem.Text;
> items.Quantity = ddlQuantity.Text;
> Session.Add("ItemOrder", items);
> Session["RowCount"] = ItemTable.Rows.Count;
> }
> else //For every other time the button is clicked
> {
> txtPendingShip.Text = "Test";
> }
> }
I was going to address that once I got past the row adding hurdle,
I've been stuck on that for about a day now...
Looch wrote:
> ItemTable.Rows.Add(row);
Try
ItemTable.Rows.Add(row.Clone);
otherwise you're always adding a /reference/ to the same variable rather
than the data in that variable.
Andrew
table server control -- make column invisible
that has three columns. Sometimes I need the second column to be invisible,
sometimes the third. How can I set a column to be invisible in code? There
appears to not be a programmatic way to work with columns in the way that
there is rows.
Thanks.
--SusanI don't think there a Column Visible property for the WebControls.Table object. So you may have to handle this on your own
For example
foreach(TableRow tr in myTable.Rows
tr.Cells[yourcolumnindex].Visible = false
HTH
Suresh
-- Susan Geller wrote: --
I have a table server control (System.Web.UI.WebControls.Table) on my for
that has three columns. Sometimes I need the second column to be invisible
sometimes the third. How can I set a column to be invisible in code? Ther
appears to not be a programmatic way to work with columns in the way tha
there is rows
Thanks
--Susa
Table Web Control
I've completed the table on load, and all of the checkbox controls load up as expected, however I now need to submit any changes based on the users values. I've been googling for a good article on the Table web control but haven't found anything that will help. Does anyone know of any articles, or have sample code for maintaining state of these controls and iterating through them so I can create my dynamic SQL based on selections?
Thanks.From the SDK:
"Note: Programmatic additions or modifications to a table row or cell will not persist across posts to the server. Table rows and cells are controls of their own, not properties of the Table control. Changes to table rows or cells must be reconstructed after each post to the server."
Ok, so I think that answers my viewstate problem. I DO recreate this table on page load everytime, so I don't think I need to worry about that.
Any help on muddling through the selected checkboxes of a dynamically created table web control, would still be very beneficial to my cause.
Ugh, I'm fried here...
The viewstate will STILL be a problem, because I wasn't thinking that with each postback, my table would just be re-created, therefore I won't get the modified values on submission.
I keep talking to myself but oh well...
Just to reiterate, I need help on maintaing state for a dynamically created table web control, and how to iterate through the controls that were created in that table on postback.
Dear Forum,
Hi! It's me again!
Ok, so after a little more research I found that people are suggesting the Request.Form() to collect information about the controls. Does that sound right? I guess if you can't take advantage of viewstate in this situation, then Request.Form() is the way to go.
Taking that into consideration, I don't think I can really "iterate" through the controls in my dynamic table, but maybe create some variables that will hold the number of checkbox controls say, when I create the table. So maybe it would look something like this:
pseudocode -
' Creating the table
Dim cb as CheckBox
Dim cbCounter as Int32
'Dynamically create checkbox here and increment the checkbox counter
Then later when I retireve the values within my table...
'Go through each of the checkboxes and determine the value
for x=0 to cbCounter.Length - 1
'check the value of checkbox "x" here
Does this sound like a logical resolution? Am I taking this too far and there is an easier path that I'm missing here? Does anyone really care at this point? :)
Hi FrankWhite,
I'm having the same problem here. I'm fetching values from a MySQL database, I show them in a nice table with checkboxes. But when the user clicks "submit" my checkboxes are lost (since my table won't keep them).
So I'm looking for the same solution: how can I keep all generated checkboxes, so I can check which of them are checked by the user?
If someone has experience with this scenario and knows how it can be done, please post it here for me and FrankWhite ;)
Thanks in advance!
1. Try to stay away from dynamically creating controls that need to keep their values during postbacks.
2. Modify the way you search for information. More than 50% of programming involves just trying to find out how to do stuff. Your problem is not with viewstate, but with the ASP.NET lifecycle.
To answer both your question, you will need some patients.This article will answer your questions, but you have to read every word carefully. DONT skip to the end and read the conclusion as you will miss out on important things that you should learn.
Jagdip
(Haven't read the article yet)
I did come to a solution the other day. Basically on Page_Load my table is recreated everytime. When the submit button is pressed, I simply do Request.Form() on the checkbox controls. I don't have the code in front of me at the moment, but I basically did the following to solve my problem.
1.) Created a variable that would serve as a counter for my checkboxes.
2.) When the checkbox was created, I would give it the id: "chk_" & chkCtrls (variable that was the counter)
3.) In the btn_submit() I created a loop to iterate through each of the checkbox controls (well not really the controls, rather the # of controls). In the loop I would check if the checkbox was checked and do something according to that:
for x = 0 to chkCtrls
if Request.Form("chk_" & x) = "On" Then
'do something
end if
next
There was a lot more to it then this for my situation, but I think this will give you a good idea. Let me know if this helps, or if you figured out a different solution. In the meantime, I'll need to peep this article...
I used the same solution, I recreated my checkbox collection each time in Page_load, and used Request.Form to check wether the "check all" was checked or unchecked to set a default checked value on each checkbox (true/false). Then on the submit button I used Request.Form again to check the status of each generated checkbox by checking for controls like "chk" + intID.
This does the trick I needed very well.
I'll take a look at the article as well, in case this is not the right way of programming this :)
Thanks for the help,
Speerman
Alright, alright, I'll give you the jist of it. I'm not an expert in this (just been reading around a lot) so here goes.
Basically, the ASP.NET life cylce loads your info like this:
Page_Init
Load ViewState
Page_Load
Run any controls functions (e.g. button_click functions, etc.)
From this you can see that if you create controls dynamically, then they will be displayed on the page; but their viewstate will not be 'loaded'. What we need is a way to create the controls before the Load Viewstate state.
Solution: If you are using VS, the you know there is a region called " Web Form Designer Generated Code ". In this you will find:
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()End Sub
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
All you need to do is call the function that creates the dynamic controls from within the Page_Init function. That's it (i think - havent got a chance to try it).
But please, read the article. You will have a better understanding of ASP.NET which means better pages (and maybe a pay rise - you can tell why I read the aticles ;-)
HTH
Jagdip
table with a scrollbar?
cause the user control to scroll its conents when its container is too
small, or will I just have to make its height = 100% so it can't cause its
container to resize too big?
PaulYou can put your table (or any control) into a fixed size area by putting it
in a scrollable div such as this:
<div id="Layer1" style=" position:relative;width:350px;height:200
px;overflow:
scroll;">control goes here</div>
The key is to use the "overflow" CSS attribute.Here's more info:
http://www.w3schools.com/css/pr_pos_overflow.asp
Another option is to put your control in an IFrame.
http://msdn.microsoft.com/workshop/...ects/IFRAME.asp
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"PJ6" <nobody@.nowhere.net> wrote in message
news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>I have a user control (HTML table) within a table. Would it be possible to
>cause the user control to scroll its conents when its container is too
>small, or will I just have to make its height = 100% so it can't cause its
>container to resize too big?
> Paul
>
Thanks, that's exactly what I was looking for.
Paul
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eI5ghT3oFHA.3912@.TK2MSFTNGP10.phx.gbl...
> You can put your table (or any control) into a fixed size area by putting
> it in a scrollable div such as this:
> <div id="Layer1"
> style=" position:relative;width:350px;height:200
px;overflow:
> scroll;">control goes here</div>
> The key is to use the "overflow" CSS attribute.Here's more info:
> http://www.w3schools.com/css/pr_pos_overflow.asp
> Another option is to put your control in an IFrame.
> http://msdn.microsoft.com/workshop/...://SteveOrr.net
>
> "PJ6" <nobody@.nowhere.net> wrote in message
> news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>
You may also find this useful. Freeze columns and rows
like Excel but in your html table:
http://www.eggheadcafe.com/articles...rol.asp
Robbe Morris - 2004/2005 Microsoft MVP C#
Earn money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp
"PJ6" <nobody@.nowhere.net> wrote in message
news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>I have a user control (HTML table) within a table. Would it be possible to
>cause the user control to scroll its conents when its container is too
>small, or will I just have to make its height = 100% so it can't cause its
>container to resize too big?
> Paul
>
table with a scrollbar?
cause the user control to scroll its conents when its container is too
small, or will I just have to make its height = 100% so it can't cause its
container to resize too big?
PaulYou can put your table (or any control) into a fixed size area by putting it
in a scrollable div such as this:
<div id="Layer1" style="position:relative;width:350px;height:200px;overflo w:
scroll;">control goes here</div
The key is to use the "overflow" CSS attribute.Here's more info:
http://www.w3schools.com/css/pr_pos_overflow.asp
Another option is to put your control in an IFrame.
http://msdn.microsoft.com/workshop/...ects/IFRAME.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"PJ6" <nobody@.nowhere.net> wrote in message
news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>I have a user control (HTML table) within a table. Would it be possible to
>cause the user control to scroll its conents when its container is too
>small, or will I just have to make its height = 100% so it can't cause its
>container to resize too big?
> Paul
Thanks, that's exactly what I was looking for.
Paul
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eI5ghT3oFHA.3912@.TK2MSFTNGP10.phx.gbl...
> You can put your table (or any control) into a fixed size area by putting
> it in a scrollable div such as this:
> <div id="Layer1"
> style="position:relative;width:350px;height:200px;overflo w:
> scroll;">control goes here</div>
> The key is to use the "overflow" CSS attribute.Here's more info:
> http://www.w3schools.com/css/pr_pos_overflow.asp
> Another option is to put your control in an IFrame.
> http://msdn.microsoft.com/workshop/...ects/IFRAME.asp
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "PJ6" <nobody@.nowhere.net> wrote in message
> news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>>I have a user control (HTML table) within a table. Would it be possible to
>>cause the user control to scroll its conents when its container is too
>>small, or will I just have to make its height = 100% so it can't cause its
>>container to resize too big?
>>
>> Paul
>>
You may also find this useful. Freeze columns and rows
like Excel but in your html table:
http://www.eggheadcafe.com/articles...ver_control.asp
--
Robbe Morris - 2004/2005 Microsoft MVP C#
Earn money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp
"PJ6" <nobody@.nowhere.net> wrote in message
news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>I have a user control (HTML table) within a table. Would it be possible to
>cause the user control to scroll its conents when its container is too
>small, or will I just have to make its height = 100% so it can't cause its
>container to resize too big?
> Paul
Table? Frameset or User control?
I am new with ASP and now developing a web application that having two navigation menu.One is at left and another is at top side. When a user click a hyperlink at left, the top navigation menu will change according the hyperlinks at left. And when the user click the hyperlink at top, it will display the required page at bottom right hand side.
I have no idea whether the navigation menu develop as frame, table or user control. Can anyone sharing your opinion? Thanks.Hello, the menu should be a usercontrol, and you should have a look at this page to know how to setp up your pages:
Master Pages
regards
Wednesday, March 28, 2012
TableCell: BackColor Property But No BackGround Property?
has a background attribute and a bgcolor attribute. The TableCell has a
BackColor property, which is the equivelant of the HTML bgcolor attribute,
but what can I use as an equivelant for the HTML background attribute?
Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/I would have to look but my first thought is this. The control will render
whatever attribute you add. So you can add it declaratively with
attribute="value" syntax or on in the code you can add it through the
Attributes collection on the control.
C#
control.Attributes.Add("Name", "Value");
I think you can do this too, because I think it is a NameValueCollection
which means it handles the add automatically.
control.Attributes["Name"] = "Value";
"Nathan Sokalski" wrote:
> I am using an ASP:Table Control to make a table. I know that the HTML TD tag
> has a background attribute and a bgcolor attribute. The TableCell has a
> BackColor property, which is the equivelant of the HTML bgcolor attribute,
> but what can I use as an equivelant for the HTML background attribute?
> Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>
TableCell.Text property overwrites dynamic control
property, the hidden control is not output. If I set the text first, then
the hidden control is output but the text is not. No errors are generated.
I can make it work by adding a literal control instead of using the text
property, but why doesn't the "simple" method work?
Dim tCell As TableCell = New TableCell
Dim thidden As HtmlInputHidden = New HtmlInputHidden
thidden.ID = "h1"
thidden.Value = "hidden text"
tCell.Controls.Add(thidden)
tCell.Text = "visible text"
tRow.Cells.Add(tCell)Maybe add the text as a literal?
Joe
"Bob Voss" <bvoss@.Xspam.tsts.com> wrote in message
news:%23iH0xNNxDHA.2408@.tk2msftngp13.phx.gbl...
> If I add a hidden input control to a tablecell and then set the cell's
text
> property, the hidden control is not output. If I set the text first, then
> the hidden control is output but the text is not. No errors are
generated.
> I can make it work by adding a literal control instead of using the text
> property, but why doesn't the "simple" method work?
> Dim tCell As TableCell = New TableCell
> Dim thidden As HtmlInputHidden = New HtmlInputHidden
> thidden.ID = "h1"
> thidden.Value = "hidden text"
> tCell.Controls.Add(thidden)
> tCell.Text = "visible text"
> tRow.Cells.Add(tCell)
TableFooterRow & lines
ASP.NET 2.0
On a webpage I've placed a table (server control) which consist of 2 columns
("Description" and "Amount")... At the buttom of the table I have a
TableFooterRow. In this TableFooterRow I want to display the sum of all the
amounts in the table. Right above the content in the TableFooterRow I want
a line to be displayed which separate that amount from the other amounts in
the table... In addition I would like to have a double line under the amount
in TableFooterRow...
example:
xxxxx : 2 000
yyyyy: 4 000
--
total: 6 000
=========
any ideas how to accomplish this?Use css styles to set top and bottom border for the footer row.
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Jeff" <donot@.spam.me> wrote in message
news:et0C7iEVIHA.5300@.TK2MSFTNGP03.phx.gbl...
> hey
> ASP.NET 2.0
> On a webpage I've placed a table (server control) which consist of 2
> columns ("Description" and "Amount")... At the buttom of the table I have
> a TableFooterRow. In this TableFooterRow I want to display the sum of all
> the amounts in the table. Right above the content in the TableFooterRow I
> want a line to be displayed which separate that amount from the other
> amounts in the table... In addition I would like to have a double line
> under the amount in TableFooterRow...
> example:
> xxxxx : 2 000
> yyyyy: 4 000
> --
> total: 6 000
> =========
> any ideas how to accomplish this?
>
I'm trying but the borders will not display... here is how I do it:
css:
.test
{
border-top:solid 2px Black;
background-color:Green; // debug info - I see the footer get a green
background,
// so the footer is reading this
css info
border-bottom:double 2px Black
}
<asp:TableFooterRow CssClass="test">
The footer get a green background color, but no borders... what am I doing
wrong here?
It is a known effect for table rows. Set borders instead for every cell.
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Jeff" <donot@.spam.me> wrote in message
news:%23GcKQQFVIHA.5360@.TK2MSFTNGP03.phx.gbl...
> I'm trying but the borders will not display... here is how I do it:
> css:
> .test
> {
> border-top:solid 2px Black;
> background-color:Green; // debug info - I see the footer get a green
> background,
> // so the footer is reading
> this css info
> border-bottom:double 2px Black
> }
> <asp:TableFooterRow CssClass="test">
> The footer get a green background color, but no borders... what am I doing
> wrong here?
>
TableLayoutPanel Control
Hi!
I am trying to create an Excel-like table in Visual Basic 2005 / Visual C# 2005 EE.
I use TableLayoutPanel control to present the data.
However, I found out that this table layout is not very efficient, like: I can't draw the border for specific cell, nor can I resize one cell to be bigger than others.
Is there a way to do this? Or maybe there is a better way to create an Excel-like table?
Many thanks in advanced!!!!
Hi,
Is this a web control??
Actually, I use Visual Basic 2005 EE for Windows Form. I don't know if VWD 2005 EE has the same control or not.
I am trying to build an application that run in Windows OS. The application will need this Excel-like table layout.
Thanks for you help and time, really appreciated that.
Can somebody help me please?
Many thanks in advanced!
Tables automatically resizes
The problem I have is that I create the outer table and set the size
properties to what I want them to be, then, if I put another table
into the first cell, when I resize that nested table, it automatically
resizes the other cells also. If I do the same type of thing in
Dreamweaver, this doesn't happen. Is there a setting of some sort in
..NET that I can turn off to prevent this from happening?
Here is the html code for the table. Sorry about the formatting.
It is the tblMenuBar table, that when I resize it, vertically, resizes
the other cells in the outer table.
<body class="BasePage" bottomMargin="0" leftMargin="0" topMargin="0"
rightMargin="0">
<form id="frmLogin" method="post" runat="server">
<TABLE id="tblBase" height="100%" cellSpacing="0" cols="4"
cellPadding="0" width="1000" border="0">
<TR>
<TD class="MenuBar" width="177" rowSpan="3">
<TABLE id="tblMenuBar" height="100%" cellSpacing="1"
cellPadding="1" width="177" border="1">
<TR>
<TD height="50" width="100%">
<asp:HyperLink id="HyperLink1"
runat="server">HyperLink</asp:HyperLink></TD>
</TR>
</TABLE>
</TD>
<td class="FormSpacer" width="22" bgColor="#ffffff"
rowSpan="3"></td>
<td class="PageHeader" vAlign="top" align="middle" width="601"
style="HEIGHT: 0.64in">
<uc1:pageheader id="PageHeader" runat="server"></uc1:pageheader>
</td>
<td class="FormSpacer" width="200" rowSpan="3"></td>
</TR>
<TR>
<TD class="WorkSpace" vAlign="top">
<div align="center">
<asp:hyperlink id="hplSecureSession" runat="server"
NavigateUrl="https://statslink.streck.com/">Click here for SECURE
INTERNET SESSION</asp:hyperlink>
</div>
<DIV align="center" class="WorkSpace" noWrap>
</DIV>
</TD>
</TR>
<TR>
<td class="PageFooter" height="50">
<uc1:pagefooter id="PageFooter" runat="server"></uc1:pagefooter>
</td>
</TR>
</TABLE>
</form>
</body
Thank you!
KalvinGive tblBase a specific height of 50.
Give tblMenuBar a specific height of 50, as well as the first cell in the
first row of tblMenuBar; give it a height of 50 too.
In fact, for anything that shouldn't be taller than 50 pixels, give anything
involved in it a hard-coded height of 50.
Avoid putting anything taller than 50 pixes in the cells of tblMenuBar.
This may or may not fix your problem, but it's good practice to be very
specific with tables when you need them to behave in a precise manner.
"Kalvin" <ktuel@.streck.com> wrote in message
news:879688dc.0308081113.2fa335b3@.posting.google.c om...
> I am using a nested table to control different elements of my layout.
> The problem I have is that I create the outer table and set the size
> properties to what I want them to be, then, if I put another table
> into the first cell, when I resize that nested table, it automatically
> resizes the other cells also. If I do the same type of thing in
> Dreamweaver, this doesn't happen. Is there a setting of some sort in
> .NET that I can turn off to prevent this from happening?
> Here is the html code for the table. Sorry about the formatting.
> It is the tblMenuBar table, that when I resize it, vertically, resizes
> the other cells in the outer table.
>
> <body class="BasePage" bottomMargin="0" leftMargin="0" topMargin="0"
> rightMargin="0">
> <form id="frmLogin" method="post" runat="server">
> <TABLE id="tblBase" height="100%" cellSpacing="0" cols="4"
> cellPadding="0" width="1000" border="0">
> <TR>
> <TD class="MenuBar" width="177" rowSpan="3">
> <TABLE id="tblMenuBar" height="100%" cellSpacing="1"
> cellPadding="1" width="177" border="1">
> <TR>
> <TD height="50" width="100%">
> <asp:HyperLink id="HyperLink1"
> runat="server">HyperLink</asp:HyperLink></TD>
> </TR>
> </TABLE>
> </TD>
> <td class="FormSpacer" width="22" bgColor="#ffffff"
> rowSpan="3"></td>
> <td class="PageHeader" vAlign="top" align="middle" width="601"
> style="HEIGHT: 0.64in">
> <uc1:pageheader id="PageHeader" runat="server"></uc1:pageheader>
> </td>
> <td class="FormSpacer" width="200" rowSpan="3"></td>
> </TR>
> <TR>
> <TD class="WorkSpace" vAlign="top">
> <div align="center">
> <asp:hyperlink id="hplSecureSession" runat="server"
> NavigateUrl="https://statslink.streck.com/">Click here for SECURE
> INTERNET SESSION</asp:hyperlink>
> </div>
> <DIV align="center" class="WorkSpace" noWrap>
> </DIV>
> </TD>
> </TR>
> <TR>
> <td class="PageFooter" height="50">
> <uc1:pagefooter id="PageFooter" runat="server"></uc1:pagefooter>
> </td>
> </TR>
> </TABLE>
> </form>
> </body>
> Thank you!
> Kalvin
Monday, March 26, 2012
tables in asp.net
Yup. You'll also find that different browsers will display differently as well. You can live with it, control the layout precisely with specific width and height attributes as well as font sizing and hope it works in most browser, or work with CSS instead of tables. But it's the nature of the environment, you don't control what the user sees, the user and the user's browser does.
Jeff
i would have loved the older way. ie coding it and not using the design way. so that u get a better control of where you want to put the control
Tables Login
I've developed an application in VB .NET 2005. To login I've used the login
view control of ASP .NET 2005. But now I've to install it, and I don't know
how could I create the tables to login?.
My apologize for my english.
Thanks for all,
SilviaLl.Which database are you using? I believe that there is an Access membership
provider somewhere, if so it's probably on the www.asp.net website.
You can install the membership to a web server using a utility found in the
Windows\Microsoft.Net\Framework\v2.0.50727 directory. The utility is called
aspnet_regsql.exe. It should launch a wizard that will walk you through
creating all the necessary items for using membership as well as role
management and personalization.
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199...2006
"Silviall" <slladoARROBAgmailPUNTOcoEME> wrote in message
news:O$S9PWq$GHA.3836@.TK2MSFTNGP02.phx.gbl...
> Hello,
> I've developed an application in VB .NET 2005. To login I've used the
> login view control of ASP .NET 2005. But now I've to install it, and I
> don't know how could I create the tables to login?.
> My apologize for my english.
> Thanks for all,
> SilviaLl.
>
Hello Mark,
I'm using SQL Server.
Thanks for all,
SilviaLl.
"Mark Fitzpatrick" <markfitz@.fitzme.com> escribi en el mensaje
news:uH7aGvq$GHA.4024@.TK2MSFTNGP04.phx.gbl...
> Which database are you using? I believe that there is an Access membership
> provider somewhere, if so it's probably on the www.asp.net website.
> You can install the membership to a web server using a utility found in
> the Windows\Microsoft.Net\Framework\v2.0.50727 directory. The utility is
> called aspnet_regsql.exe. It should launch a wizard that will walk you
> through creating all the necessary items for using membership as well as
> role management and personalization.
>
> --
> Hope this helps,
> Mark Fitzpatrick
> Former Microsoft FrontPage MVP 199...2006
> "Silviall" <slladoARROBAgmailPUNTOcoEME> wrote in message
> news:O$S9PWq$GHA.3836@.TK2MSFTNGP02.phx.gbl...
>
Tables Login
I've developed an application in VB .NET 2005. To login I've used the login
view control of ASP .NET 2005. But now I've to install it, and I don't know
how could I create the tables to login?.
My apologize for my english.
Thanks for all,
SilviaLl.Which database are you using? I believe that there is an Access membership
provider somewhere, if so it's probably on the www.asp.net website.
You can install the membership to a web server using a utility found in the
Windows\Microsoft.Net\Framework\v2.0.50727 directory. The utility is called
aspnet_regsql.exe. It should launch a wizard that will walk you through
creating all the necessary items for using membership as well as role
management and personalization.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Silviall" <slladoARROBAgmailPUNTOcoEMEwrote in message
news:O$S9PWq$GHA.3836@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hello,
>
I've developed an application in VB .NET 2005. To login I've used the
login view control of ASP .NET 2005. But now I've to install it, and I
don't know how could I create the tables to login?.
>
My apologize for my english.
>
Thanks for all,
>
SilviaLl.
>
Hello Mark,
I'm using SQL Server.
Thanks for all,
SilviaLl.
"Mark Fitzpatrick" <markfitz@.fitzme.comescribi en el mensaje
news:uH7aGvq$GHA.4024@.TK2MSFTNGP04.phx.gbl...
Quote:
Originally Posted by
Which database are you using? I believe that there is an Access membership
provider somewhere, if so it's probably on the www.asp.net website.
>
You can install the membership to a web server using a utility found in
the Windows\Microsoft.Net\Framework\v2.0.50727 directory. The utility is
called aspnet_regsql.exe. It should launch a wizard that will walk you
through creating all the necessary items for using membership as well as
role management and personalization.
>
>
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
>
"Silviall" <slladoARROBAgmailPUNTOcoEMEwrote in message
news:O$S9PWq$GHA.3836@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
>Hello,
>>
>I've developed an application in VB .NET 2005. To login I've used the
>login view control of ASP .NET 2005. But now I've to install it, and I
>don't know how could I create the tables to login?.
>>
>My apologize for my english.
>>
>Thanks for all,
>>
>SilviaLl.
>>
>
>
Taborder after postback
is not the one defined in the taborder, but the first control.
This makes sense becuase the page is reloaded, but of course this
is not the desired behaviour.
I have seen the use of a hidden field, which stores the name of the control
that should get focus next, being set in the autopostback event, then an
OnPageLoad javascript that sets the focus to it.
This works, but only for 'forward' tabs, and the next control has nothing
to do with the taborder but is set in code.
It seems like there should be a better solution to this problem.
Actually, it seems like the viewstate should handle this automatically.
Any ideas or solutions?
kpg"kpg" <no@.way.com> wrote in message
news:Xns97CE93E88E40Cipostthereforeiam@.2
07.46.248.16...
> It seems like there should be a better solution to this problem.
There doesn't need to be, as it's fully customisable server-side.
> Actually, it seems like the viewstate should handle this automatically.
ViewState simply preserves values in form field either side of a postback
until / unless they are changed by that postback - no more, no less.
> Any ideas or solutions?
You already know which of your client-side objects (button, dropdownlist,
hyperlink, checkbox etc) has caused the postback, and write server-side code
to be processed accordingly. Simply add the following to the end of the
server-side code as required:
ClientScript.RegisterStartupScript(this.GetType(), "focus",
"<script>document.getElementById('...').focus();</script>");
Obviously, replace ... with the ID of the control that you want to receive
the focus.
N.B. this is v2 syntax, but v1.1 is almost identical.
As Mark Rae once said in microsoft.public.dotnet.framework.aspnet
> ClientScript.RegisterStartupScript(this.GetType(), "focus",
> "<script>document.getElementById('...').focus();</script>");
Well, that is a more eloquent solution than the one I had
described and I thank you for it.
It does still leave the (albeit small) issue of the user
pressing a shift-tab on an autopostback field. In that
case it would still move forward in the tab order.
And not to dwell on this point to much, my comment about
the viewstate was to simply introduce the concept that
the page 'knows' where it would have set focus to before
the postback, and as such it could remember this bit of
information somewhere (the viewstate for lack of a better
place?) and automatically move the focus there when the page
is returned. Perhaps there are reasons why this can't be
done, it was just an intuitive thought I had.
But as it stands I'll use your suggestion.
Thanks.
kpg
"kpg" <no@.way.com> wrote in message
news:Xns97CEA8488D4E8ipostthereforeiam@.2
07.46.248.16...
> It does still leave the (albeit small) issue of the user
> pressing a shift-tab on an autopostback field. In that
> case it would still move forward in the tab order.
Hmm - yeah, OK, I know what you mean but as you hint at, the likelihood of
this happening is fairly small. I've always been a great believer in the
80/20 rule for web development i.e. 20% of effort supplies 80% of usability,
and just how far you go to supplying the final 20% is really down to
time/budget/sanity...
> And not to dwell on this point to much, my comment about
> the viewstate was to simply introduce the concept that
> the page 'knows' where it would have set focus to before
> the postback, and as such it could remember this bit of
> information somewhere (the viewstate for lack of a better
> place?) and automatically move the focus there when the page
> is returned. Perhaps there are reasons why this can't be
> done, it was just an intuitive thought I had.
No, the ViewState really doesn't know this - that's not what it's for.
The ViewState's one and only purpose is to persist form values and page
variables across postbacks.
You as the programmer know what's supposed to happen next, so go to it -
that's your job! :-)
As Mark Rae once said in microsoft.public.dotnet.framework.aspnet
> You as the programmer know what's supposed to happen next, so go to it
> - that's your job! :-)
Point taken, but of course languages do indeed provide much of
what programmers used to do. Case in point - tab order. In
DOS programming (I know, I go way back) the programmer had to
specify all possible movements based on left, right, up, down,
tab, CR. Then in windows programming, tab order was introduced,
and the run time system handled movement. Well, all that spoiled
me, so with web programming (which I'm new to, can you tell?) I
see many areas where we are taking a step backwards.
Well, I've ridden this point well into the ground so I'll stop.
Thanks for your help.
kpg
Taborder after postback
is not the one defined in the taborder, but the first control.
This makes sense becuase the page is reloaded, but of course this
is not the desired behaviour.
I have seen the use of a hidden field, which stores the name of the control
that should get focus next, being set in the autopostback event, then an
OnPageLoad javascript that sets the focus to it.
This works, but only for 'forward' tabs, and the next control has nothing
to do with the taborder but is set in code.
It seems like there should be a better solution to this problem.
Actually, it seems like the viewstate should handle this automatically.
Any ideas or solutions?
kpg"kpg" <no@.way.com> wrote in message
news:Xns97CE93E88E40Cipostthereforeiam@.207.46.248. 16...
> It seems like there should be a better solution to this problem.
There doesn't need to be, as it's fully customisable server-side.
> Actually, it seems like the viewstate should handle this automatically.
ViewState simply preserves values in form field either side of a postback
until / unless they are changed by that postback - no more, no less.
> Any ideas or solutions?
You already know which of your client-side objects (button, dropdownlist,
hyperlink, checkbox etc) has caused the postback, and write server-side code
to be processed accordingly. Simply add the following to the end of the
server-side code as required:
ClientScript.RegisterStartupScript(this.GetType(), "focus",
"<script>document.getElementById('...').focus();</script>");
Obviously, replace ... with the ID of the control that you want to receive
the focus.
N.B. this is v2 syntax, but v1.1 is almost identical.
As Mark Rae once said in microsoft.public.dotnet.framework.aspnet
> ClientScript.RegisterStartupScript(this.GetType(), "focus",
> "<script>document.getElementById('...').focus();</script>");
Well, that is a more eloquent solution than the one I had
described and I thank you for it.
It does still leave the (albeit small) issue of the user
pressing a shift-tab on an autopostback field. In that
case it would still move forward in the tab order.
And not to dwell on this point to much, my comment about
the viewstate was to simply introduce the concept that
the page 'knows' where it would have set focus to before
the postback, and as such it could remember this bit of
information somewhere (the viewstate for lack of a better
place?) and automatically move the focus there when the page
is returned. Perhaps there are reasons why this can't be
done, it was just an intuitive thought I had.
But as it stands I'll use your suggestion.
Thanks.
kpg
"kpg" <no@.way.com> wrote in message
news:Xns97CEA8488D4E8ipostthereforeiam@.207.46.248. 16...
> It does still leave the (albeit small) issue of the user
> pressing a shift-tab on an autopostback field. In that
> case it would still move forward in the tab order.
Hmm - yeah, OK, I know what you mean but as you hint at, the likelihood of
this happening is fairly small. I've always been a great believer in the
80/20 rule for web development i.e. 20% of effort supplies 80% of usability,
and just how far you go to supplying the final 20% is really down to
time/budget/sanity...
> And not to dwell on this point to much, my comment about
> the viewstate was to simply introduce the concept that
> the page 'knows' where it would have set focus to before
> the postback, and as such it could remember this bit of
> information somewhere (the viewstate for lack of a better
> place?) and automatically move the focus there when the page
> is returned. Perhaps there are reasons why this can't be
> done, it was just an intuitive thought I had.
No, the ViewState really doesn't know this - that's not what it's for.
The ViewState's one and only purpose is to persist form values and page
variables across postbacks.
You as the programmer know what's supposed to happen next, so go to it -
that's your job! :-)
As Mark Rae once said in microsoft.public.dotnet.framework.aspnet
> You as the programmer know what's supposed to happen next, so go to it
> - that's your job! :-)
Point taken, but of course languages do indeed provide much of
what programmers used to do. Case in point - tab order. In
DOS programming (I know, I go way back) the programmer had to
specify all possible movements based on left, right, up, down,
tab, CR. Then in windows programming, tab order was introduced,
and the run time system handled movement. Well, all that spoiled
me, so with web programming (which I'm new to, can you tell?) I
see many areas where we are taking a step backwards.
Well, I've ridden this point well into the ground so I'll stop.
Thanks for your help.
kpg
tabpage control in web.ui?
For a cross-browser solution, you could useCSS tabs.
I hope this helps.
Microsoft has provided a web tab control. This is available at
http://msdn.microsoft.com/library/default.asp?url=/workshop/webcontrols/webcontrols_entry.asp
This control needs to be downloaded and installed.
Thanks
oh, i never knew i can download these controls.
how about MessageBox, confirm, and prompt? these can only be done using javascript now.
does microsoft provide them also? seems i can't find them yet.
thankx a lot.
I'm not aware of any thing other than JS.
In newer versions of IE, there is a JS function for showing window as a Modal Dialog. You may look into JS syntax for "showModalDialog"
Thanks
to add a message box (say, confirm a delete)add your button as normal
<asp:Button id="btnSave" runat="Server"> </asp:Button>
Then in your code, you can add an attribute
btnSave.Attributes.Add("OnClick","javascript: return confirm('Are you Sure?');");Hope this is what you were after.
TabPage Control ?
Hello,
I want to create a TabPage control for my web application like one page layout with 2 different pages, but in the toolbox VS2005 doesn't have that option, So instead of creating 2 different pages and directing from one to the another, I'm wondering if I could use the TabPage control to keep one page layout and have the ability to flip back and fourth from one page to another, Does anyone knows how to do it and really appreciated if have any tips or suggestions on how to accomplish this, thanks
Have you considered using the ASP.NET AJAX TabControl or using a MultiView control to simulates Tabs?
I would consider to try both if it works, How do you setup the ASP.NET AJAX TabControl in Visual Studio 2005 ? In the toolbox control it doesn't have any TabControl option, all I have is the MultiView in the toolbox but I'm not sure how to setup the multi page inside the MultiView control, Can you guide me through this? thanks
Refer the the link below for an example on using the ASP.NET AJAX TabControl.
http://www.asp.net/learn/ajax-videos/video-156.aspx
Here are a few links for the MultiView Control.
http://www.codeproject.com/aspnet/TabControl.asp
http://www.c-sharpcorner.com/UploadFile/mahesh/Multiview10092005215233PM/Multiview.aspx?ArticleID=ad731f33-820e-4968-89fa-393c43872384
http://www.internet.com/video/ Scroll down the leftside under Developer Videos the Using ASP.NET 2.0 MultiView Control is the last one.
Hope these help.
Tabs Control
I downloaded it but can seem to find the control, where is it located?
Please help!
Assistance would be great as this is very important.
TabStrip
I am wanting to create my own TabStrip control, similar to the one that this site uses. The only problem is that I cannot find any tutorials/examples in vb.Net. Can someone help me out?
Thanks, OGHSGo there:http://www.asp.net/IEWebControls/Download.aspx?tabindex=0&tabid=1