Showing posts with label multiple. Show all posts
Showing posts with label multiple. Show all posts

Saturday, March 31, 2012

Table Rows

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.
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 where I want to draw a border around the whole table but not between the cells.

I have a table with multiple cells and I want to draw a box around the
entire table but not around the individual cells. How do I do that?

TIA - Jeff."UJ" <fred@.nowhere.com>'s wild thoughts were released on
Thu, 8 Jun 2006 10:49:39 -0400 bearing the following fruit:

>I have a table with multiple cells and I want to draw a box around the
>entire table but not around the individual cells. How do I do that?
>TIA - Jeff.

IIRC just setting the borders on the table should do it.

Jan Hyde (VB MVP)

--
I don't have a solution but I admire the problem.
If you are asking about a .net table you can do:

Table table = new Table();
table.Style.Add("border-width","1px");
table.Style.Add("border-color","#000000");
table.Style.Add("border-style","solid");

Or just an html table:

<table border="0" style="border-width: 1px; border-color:#000000;
border-style: solid;">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table
And there is a ton of different borders you can use, just google css
border-style

"UJ" wrote:

> I have a table with multiple cells and I want to draw a box around the
> entire table but not around the individual cells. How do I do that?
> TIA - Jeff.
>
But doesn't that put a border around everything including the cells? I need
just a border around the outside of the table.

"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
> If you are asking about a .net table you can do:
> Table table = new Table();
> table.Style.Add("border-width","1px");
> table.Style.Add("border-color","#000000");
> table.Style.Add("border-style","solid");
> Or just an html table:
> <table border="0" style="border-width: 1px; border-color:#000000;
> border-style: solid;">
> <tr>
> <td> </td>
> <td> </td>
> </tr>
> <tr>
> <td> </td>
> <td> </td>
> </tr>
> </table>
> And there is a ton of different borders you can use, just google css
> border-style
> "UJ" wrote:
>> I have a table with multiple cells and I want to draw a box around the
>> entire table but not around the individual cells. How do I do that?
>>
>> TIA - Jeff.
>>
>>
>
"UJ" <fred@.nowhere.com>'s wild thoughts were released on
Thu, 8 Jun 2006 16:28:28 -0400 bearing the following fruit:

>But doesn't that put a border around everything including the cells? I need
>just a border around the outside of the table.

Have you tried it?

J

>"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
>news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
>> If you are asking about a .net table you can do:
>>
>> Table table = new Table();
>> table.Style.Add("border-width","1px");
>> table.Style.Add("border-color","#000000");
>> table.Style.Add("border-style","solid");
>>
>> Or just an html table:
>>
>> <table border="0" style="border-width: 1px; border-color:#000000;
>> border-style: solid;">
>> <tr>
>> <td> </td>
>> <td> </td>
>> </tr>
>> <tr>
>> <td> </td>
>> <td> </td>
>> </tr>
>> </table>
>>
>> And there is a ton of different borders you can use, just google css
>> border-style
>>
>> "UJ" wrote:
>>
>>> I have a table with multiple cells and I want to draw a box around the
>>> entire table but not around the individual cells. How do I do that?
>>>
>>> TIA - Jeff.
>>>
>>>
>>
Jan Hyde (VB MVP)

--
A friend of mine just had her 11th baby. Everyone says she's overbearing
(Megan Waves)
I just tried it and it shows the borders on the cells also. Remember - I
just need a border around the entire object - no each individual cell.

TIA.

"Jan Hyde" <StellaDrinker@.REMOVE.ME.uboot.com> wrote in message
news:jjdi821qndfr94ie161fm83mefg2d96a9u@.4ax.com...
> "UJ" <fred@.nowhere.com>'s wild thoughts were released on
> Thu, 8 Jun 2006 16:28:28 -0400 bearing the following fruit:
>>But doesn't that put a border around everything including the cells? I
>>need
>>just a border around the outside of the table.
> Have you tried it?
> J
>>"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
>>news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
>>> If you are asking about a .net table you can do:
>>>
>>> Table table = new Table();
>>> table.Style.Add("border-width","1px");
>>> table.Style.Add("border-color","#000000");
>>> table.Style.Add("border-style","solid");
>>>
>>> Or just an html table:
>>>
>>> <table border="0" style="border-width: 1px; border-color:#000000;
>>> border-style: solid;">
>>> <tr>
>>> <td> </td>
>>> <td> </td>
>>> </tr>
>>> <tr>
>>> <td> </td>
>>> <td> </td>
>>> </tr>
>>> </table>
>>>
>>> And there is a ton of different borders you can use, just google css
>>> border-style
>>>
>>> "UJ" wrote:
>>>
>>>> I have a table with multiple cells and I want to draw a box around the
>>>> entire table but not around the individual cells. How do I do that?
>>>>
>>>> TIA - Jeff.
>>>>
>>>>
>>>>
>>
>
> Jan Hyde (VB MVP)
> --
> A friend of mine just had her 11th baby. Everyone says she's overbearing
> (Megan Waves)
Try this...it gives you just the outer border.

<table BORDER=1 RULES=NONE FRAME=BOX
kit

*** Sent via Developersdex http://www.developersdex.com ***
"UJ" <fred@.nowhere.com>'s wild thoughts were released on
Fri, 9 Jun 2006 16:38:26 -0400 bearing the following fruit:

>I just tried it and it shows the borders on the cells also. Remember - I
>just need a border around the entire object - no each individual cell.

I can't recraete your problem, my tables are set up in
exactly the way you want (my style sheet sets border-right,
border-top etc) and in IE6, Firefox and Opera I only get a
border round the whole table, cells are unaffected.

J

>TIA.
>"Jan Hyde" <StellaDrinker@.REMOVE.ME.uboot.com> wrote in message
>news:jjdi821qndfr94ie161fm83mefg2d96a9u@.4ax.com...
>> "UJ" <fred@.nowhere.com>'s wild thoughts were released on
>> Thu, 8 Jun 2006 16:28:28 -0400 bearing the following fruit:
>>
>>>But doesn't that put a border around everything including the cells? I
>>>need
>>>just a border around the outside of the table.
>>
>> Have you tried it?
>>
>> J
>>
>>>"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
>>>news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
>>>> If you are asking about a .net table you can do:
>>>>
>>>> Table table = new Table();
>>>> table.Style.Add("border-width","1px");
>>>> table.Style.Add("border-color","#000000");
>>>> table.Style.Add("border-style","solid");
>>>>
>>>> Or just an html table:
>>>>
>>>> <table border="0" style="border-width: 1px; border-color:#000000;
>>>> border-style: solid;">
>>>> <tr>
>>>> <td> </td>
>>>> <td> </td>
>>>> </tr>
>>>> <tr>
>>>> <td> </td>
>>>> <td> </td>
>>>> </tr>
>>>> </table>
>>>>
>>>> And there is a ton of different borders you can use, just google css
>>>> border-style
>>>>
>>>> "UJ" wrote:
>>>>
>>>>> I have a table with multiple cells and I want to draw a box around the
>>>>> entire table but not around the individual cells. How do I do that?
>>>>>
>>>>> TIA - Jeff.
>>>>>
>>>>>
>>>>>
>>>
>>
>>
>> Jan Hyde (VB MVP)
>>
>> --
>> A friend of mine just had her 11th baby. Everyone says she's overbearing
>> (Megan Waves)
>
Jan Hyde (VB MVP)

--
Polarize: What penguins see with (Hershy)
That works perfectly!

Thanks!

"K B" <kathyburke40@.comcast.net> wrote in message
news:uWzbCnEjGHA.3800@.TK2MSFTNGP03.phx.gbl...
> Try this...it gives you just the outer border.
> <table BORDER=1 RULES=NONE FRAME=BOX>
> kit
>
> *** Sent via Developersdex http://www.developersdex.com ***

Table where I want to draw a border around the whole table but not between the cells.

I have a table with multiple cells and I want to draw a box around the
entire table but not around the individual cells. How do I do that?
TIA - Jeff."UJ" <fred@.nowhere.com>'s wild thoughts were released on
Thu, 8 Jun 2006 10:49:39 -0400 bearing the following fruit:

>I have a table with multiple cells and I want to draw a box around the
>entire table but not around the individual cells. How do I do that?
>TIA - Jeff.
>
IIRC just setting the borders on the table should do it.
Jan Hyde (VB MVP)
I don't have a solution but I admire the problem.
Try this...it gives you just the outer border.
<table BORDER=1 RULES=NONE FRAME=BOX>
kit
*** Sent via Developersdex http://www.examnotes.net ***
That works perfectly!
Thanks!
"K B" <kathyburke40@.comcast.net> wrote in message
news:uWzbCnEjGHA.3800@.TK2MSFTNGP03.phx.gbl...
> Try this...it gives you just the outer border.
> <table BORDER=1 RULES=NONE FRAME=BOX>
> kit
>
> *** Sent via Developersdex http://www.examnotes.net ***

Saturday, March 24, 2012

TabStrip control

Do you know where can I get a free TabStrip control (for ASP.Net 2.0) with support for design-time customization, multiple tabs and change tab image?

Hi,

This might help:

http://www.codeproject.com/aspnet/WebTabStripUserControl.asp

You can try modifying it to suit your needs.

HTH,

Vivek


And also this client side tab might fit your need:Tabs.

Tuesday, March 13, 2012

targeting a response.write to a section of a web page

I have a function that calls:

response.Write("<a href='www.yadda.com >Hello</a><br />")

multiple times, creating hyperlinks like so:

Hello
Hello
Hello
Hello
Hello
Hello

Anyway, I want the values above to be put in a specific location of my
web page (inside a table cell), instead of the top, which pushes all my
content down.

Basically, I am using xquery in a search field to go through an xml
document that contains my web site navigation info, returning a url
attribute. I have the url string from the xml doc converted to a
hyperlink using the code above.

Any suggestions are appreciated.Can you drop label members where you want the links and just add this
code to your method?

label.Text = "<a href='www.yadda.com'>Hello</a>";

Hope this helps.
I ended up hiding a table within the table and appended rows and cells
with the urls.

for each book in nodeList
Dim tempRow As New TableRow()
Dim tempCell As New TableCell()
tempCell.Text = "<a class='HoverStyle' href="http://links.10026.com/?link= &
book.Attributes("url").Value & " target='_blank' a>" &
book.Attributes("title").Value & "</a>"
tempRow.Cells.Add(tempCell)
tblSearchResults.Rows.Add(tempRow)
next

thanks.
simple solution...
1) Make the table Cell Server control . <td id="cell1" runat="server"
2) keep adding all links to the cell
cell1.InnerHtml += "<a href='www.yadda.com >Hello</a><br />"

better solution.. this way u will have better control on the layout of
links
1) Make the table a Server control . <table id="table1" runat="server"
2) keep adding rows HtmlTableRow and HtmlTableCell objects to the table
for each link

targeting a response.write to a section of a web page

I have a function that calls:
response.Write("<a href='www.yadda.com >Hello</a><br />")
multiple times, creating hyperlinks like so:
Hello
Hello
Hello
Hello
Hello
Hello
Anyway, I want the values above to be put in a specific location of my
web page (inside a table cell), instead of the top, which pushes all my
content down.
Basically, I am using xquery in a search field to go through an xml
document that contains my web site navigation info, returning a url
attribute. I have the url string from the xml doc converted to a
hyperlink using the code above.
Any suggestions are appreciated.I ended up hiding a table within the table and appended rows and cells
with the urls.
for each book in nodeList
Dim tempRow As New TableRow()
Dim tempCell As New TableCell()
tempCell.Text = "<a class='HoverStyle' href="http://links.10026.com/?link= &
book.Attributes("url").Value & " target='_blank' a>" &
book.Attributes("title").Value & "</a>"
tempRow.Cells.Add(tempCell)
tblSearchResults.Rows.Add(tempRow)
next
thanks.
simple solution...
1) Make the table Cell Server control . <td id="cell1" runat="server"
2) keep adding all links to the cell
cell1.InnerHtml += "<a href='www.yadda.com >Hello</a><br />"
better solution.. this way u will have better control on the layout of
links
1) Make the table a Server control . <table id="table1" runat="server"
2) keep adding rows HtmlTableRow and HtmlTableCell objects to the table
for each link