Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Saturday, March 31, 2012

Set a bgcolor in a repeater based on databse value asp newbie

Hi,

I'm just starting to write in asp and have been trying to create a repeater
to display some data in a simple form.

The basics worked ok and then I tried to set a bgcolor on a cell based on
it's value, I have read and re-read a good few things but nothing seems to
point to this scenario directly. I know the following code doesn't actually
work but this is roughly what I'm trying to do. eventually I want to do the
same thing with dates but baby steps first :)

<ItemTemplate>
<%If #(DataBinder.Eval(Container.DataItem, "CategoryName") =
"something") Then%>'
<tr>
<td bgcolor="#ff0000">
<%Else%>
<tr>
<td bgcolor="#CCFFCC">
<% End If%>
<asp:Label runat="server" ID="Labell" Text='<%#
Eval("CategoryName") %>' />
</td>
<td bgcolor="#CCFFCC">
<asp:Label runat="server" ID="Label2" Text='<%#
Eval("Description") %>' />
</td>
</tr>
</ItemTemplate
Thanks in advance for any help

Jim FlorenceInstead of attempting to change the colour of the <ItemTemplate>, add an
<AlternatingItemTemplate> section and type the colour in there. dotNet will
then take care of the rest for you.

"Jim Florence" wrote:

> Hi,
> I'm just starting to write in asp and have been trying to create a repeater
> to display some data in a simple form.
> The basics worked ok and then I tried to set a bgcolor on a cell based on
> it's value, I have read and re-read a good few things but nothing seems to
> point to this scenario directly. I know the following code doesn't actually
> work but this is roughly what I'm trying to do. eventually I want to do the
> same thing with dates but baby steps first :)
> <ItemTemplate>
> <%If #(DataBinder.Eval(Container.DataItem, "CategoryName") =
> "something") Then%>'
> <tr>
> <td bgcolor="#ff0000">
> <%Else%>
> <tr>
> <td bgcolor="#CCFFCC">
> <% End If%>
> <asp:Label runat="server" ID="Labell" Text='<%#
> Eval("CategoryName") %>' />
> </td>
> <td bgcolor="#CCFFCC">
> <asp:Label runat="server" ID="Label2" Text='<%#
> Eval("Description") %>' />
> </td>
> </tr>
> </ItemTemplate>
> Thanks in advance for any help
> Jim Florence
"Dean" <Dean@.discussions.microsoft.com> wrote in message
news:79F7A0BD-A3ED-4605-8CE4-89DACF298D04@.microsoft.com...
Dean,

Thanks for the reply, that works great for the entire row but not for
individual cells within the row based on the cell's value or name.

What I'm eventually trying to do is set an individual date cell to be either
red, amber or green depending on how many days overdue an item is

Many thanks again

Jim

>Instead of attempting to change the colour of the <ItemTemplate>, add an
> <AlternatingItemTemplate> section and type the colour in there. dotNet
> will
> then take care of the rest for you.
>
> "Jim Florence" wrote:
>>
>> Hi,
>>
>> I'm just starting to write in asp and have been trying to create a
>> repeater
>> to display some data in a simple form.
>>
>> The basics worked ok and then I tried to set a bgcolor on a cell based on
>> it's value, I have read and re-read a good few things but nothing seems
>> to
>> point to this scenario directly. I know the following code doesn't
>> actually
>> work but this is roughly what I'm trying to do. eventually I want to do
>> the
>> same thing with dates but baby steps first :)
>>
>> <ItemTemplate>
>> <%If #(DataBinder.Eval(Container.DataItem, "CategoryName") =
>> "something") Then%>'
>> <tr>
>> <td bgcolor="#ff0000">
>> <%Else%>
>> <tr>
>> <td bgcolor="#CCFFCC">
>> <% End If%>
>> <asp:Label runat="server" ID="Labell" Text='<%#
>> Eval("CategoryName") %>' />
>> </td>
>> <td bgcolor="#CCFFCC">
>> <asp:Label runat="server" ID="Label2" Text='<%#
>> Eval("Description") %>' />
>> </td>
>> </tr>
>> </ItemTemplate>
>>
>> Thanks in advance for any help
>>
>> Jim Florence
>>
Jim,

Try this instead:
<td bgcolor='<%#(DataBinder.Eval(Container.DataItem, "CategoryName") ==
"something"?"#ff0000":"#ffffff"%>'
This assumes that you are in C#, in VB i think there is a immediate if
of IIf();

HTH,
Chris
"chris" <chris@.cubed-c.com> wrote in message
news:1151142480.516385.115290@.m73g2000cwd.googlegr oups.com...
Chris your a star,

After very minor fiddling the code is

<td bgcolor='<%# IIF (DataBinder.Eval(Container.DataItem, "CategoryName") =
"Confections","#ff0000","#ccffcc")%>'
Thanks very much for your help I tearing my hair out trying to make this
work

Regards

Jim

> Jim,
> Try this instead:
> <td bgcolor='<%#(DataBinder.Eval(Container.DataItem, "CategoryName") ==
> "something"?"#ff0000":"#ffffff"%>'>
> This assumes that you are in C#, in VB i think there is a immediate if
> of IIf();
> HTH,
> Chris

set browser window size

I am trying to display my form in a fixed browser window so the user cannot change it's size, cannot minimize/maximize the window. The aspx form is for user input, and I want each user to see the same thing. (it's an internal form and everyone has the same browser). Where do I make these changes, or what code do I need? I figured it would be in the properties menu for the form, but the page margins do not make the changes I need. Any ideas on what to do?

Thanks.You can set thewindow properties from the client (i.e. note, no "runat" attribute in the script tag), only after the first page is loaded:

<SCRIPT for="window" event="onload">
window.dialogHeight = 100;
window.dialogLeft = 100;
window.dialogTop = 100;
window.dialogWidth = 100;
</SCRIPT>

Thursday, March 29, 2012

Set CheckBox or Radio in repeater with if statement

Hi,
Attempting to display a questions list in my aspx page with the help of a
repeater.
This repeater displays each question (Label and picture) and each answer in
a nested repeater.
My problem is that each question can have ONE good answer or SEVERAL.
If the question has just one good answer, I want my answers displayed with
radio buttons.
In the other case, with checkbox.
is It Possible ?
Thks for help.Yes, but you'll most likely need to implement the logic in the ItemDataBound
event. This will let you define a placeholder in the itemTemplate which you
can then fill and dynamically create the checkbox/radiolist. You can find
out more at: http://www.openmymind.net/databinding/index.html
karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Mick" <saulot@.libertysurf.fr> wrote in message
news:41da537a$0$21436$636a15ce@.news.free.fr...
> Hi,
> Attempting to display a questions list in my aspx page with the help of a
> repeater.
> This repeater displays each question (Label and picture) and each answer
in
> a nested repeater.
> My problem is that each question can have ONE good answer or SEVERAL.
> If the question has just one good answer, I want my answers displayed with
> radio buttons.
> In the other case, with checkbox.
> is It Possible ?
> Thks for help.
>
>

Set CheckBox or Radio in repeater with if statement

Hi,
Attempting to display a questions list in my aspx page with the help of a
repeater.
This repeater displays each question (Label and picture) and each answer in
a nested repeater.

My problem is that each question can have ONE good answer or SEVERAL.
If the question has just one good answer, I want my answers displayed with
radio buttons.
In the other case, with checkbox.

is It Possible ?

Thks for help.Yes, but you'll most likely need to implement the logic in the ItemDataBound
event. This will let you define a placeholder in the itemTemplate which you
can then fill and dynamically create the checkbox/radiolist. You can find
out more at: http://www.openmymind.net/databinding/index.html

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Mick" <saulot@.libertysurf.fr> wrote in message
news:41da537a$0$21436$636a15ce@.news.free.fr...
> Hi,
> Attempting to display a questions list in my aspx page with the help of a
> repeater.
> This repeater displays each question (Label and picture) and each answer
in
> a nested repeater.
> My problem is that each question can have ONE good answer or SEVERAL.
> If the question has just one good answer, I want my answers displayed with
> radio buttons.
> In the other case, with checkbox.
> is It Possible ?
> Thks for help.

Monday, March 26, 2012

Set display order of ListBox control

Hi
I have a ListBox control in my ASP.NET page. After I binding data to this
control, I would like to be able to change this display order of items in
this control. Just like change layout function of my.yahoo.com.
I tried client side approach, yes I can change display order by JavaScript,
but after clicking one of the button the display order will reverse back to
its original status. Because after PostBack, the page will try to render
this control by viewstate again.

I tried server side approach, but looks there is no way to switch two
ListItems programmatically.

Is there anybody who has some good idea?

Thanks!

--

WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours HardyI already solved this problem.

"Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
news:upQn0K$KEHA.628@.TK2MSFTNGP11.phx.gbl...
> Hi
> I have a ListBox control in my ASP.NET page. After I binding data to this
> control, I would like to be able to change this display order of items in
> this control. Just like change layout function of my.yahoo.com.
> I tried client side approach, yes I can change display order by
JavaScript,
> but after clicking one of the button the display order will reverse back
to
> its original status. Because after PostBack, the page will try to render
> this control by viewstate again.
> I tried server side approach, but looks there is no way to switch two
> ListItems programmatically.
>
> Is there anybody who has some good idea?
> Thanks!
> --
>
> WWW: http://hardywang.1accesshost.com
> ICQ: 3359839
> yours Hardy
How?
--
Joe Fallon

"Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
news:O7ZTxp$KEHA.2244@.tk2msftngp13.phx.gbl...
> I already solved this problem.
>
> "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> news:upQn0K$KEHA.628@.TK2MSFTNGP11.phx.gbl...
> > Hi
> > I have a ListBox control in my ASP.NET page. After I binding data to
this
> > control, I would like to be able to change this display order of items
in
> > this control. Just like change layout function of my.yahoo.com.
> > I tried client side approach, yes I can change display order by
> JavaScript,
> > but after clicking one of the button the display order will reverse back
> to
> > its original status. Because after PostBack, the page will try to render
> > this control by viewstate again.
> > I tried server side approach, but looks there is no way to switch two
> > ListItems programmatically.
> > Is there anybody who has some good idea?
> > Thanks!
> > --
> > WWW: http://hardywang.1accesshost.com
> > ICQ: 3359839
> > yours Hardy
Dump content of listbox to array, sort array in memory, then clear this
listbox and add listitem from array one by one.

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
"Joe Fallon" <jfallon1@.nospamtwcny.rr.com> wrote in message
news:%23nd3uPALEHA.3052@.TK2MSFTNGP12.phx.gbl...
> How?
> --
> Joe Fallon
>
> "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> news:O7ZTxp$KEHA.2244@.tk2msftngp13.phx.gbl...
> > I already solved this problem.
> > "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> > news:upQn0K$KEHA.628@.TK2MSFTNGP11.phx.gbl...
> > > Hi
> > > I have a ListBox control in my ASP.NET page. After I binding data to
> this
> > > control, I would like to be able to change this display order of items
> in
> > > this control. Just like change layout function of my.yahoo.com.
> > > I tried client side approach, yes I can change display order by
> > JavaScript,
> > > but after clicking one of the button the display order will reverse
back
> > to
> > > its original status. Because after PostBack, the page will try to
render
> > > this control by viewstate again.
> > > > I tried server side approach, but looks there is no way to switch two
> > > ListItems programmatically.
> > > > > Is there anybody who has some good idea?
> > > > Thanks!
> > > > --
> > > > > > WWW: http://hardywang.1accesshost.com
> > > ICQ: 3359839
> > > yours Hardy
> >
Yep.
That is what my listbox sort routine does.
Just wondering if you came up with something different.
--
Joe Fallon

"Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
news:uVlWuSFLEHA.3808@.TK2MSFTNGP12.phx.gbl...
> Dump content of listbox to array, sort array in memory, then clear this
> listbox and add listitem from array one by one.
> --
> WWW: http://hardywang.1accesshost.com
> ICQ: 3359839
> yours Hardy
> "Joe Fallon" <jfallon1@.nospamtwcny.rr.com> wrote in message
> news:%23nd3uPALEHA.3052@.TK2MSFTNGP12.phx.gbl...
> > How?
> > --
> > Joe Fallon
> > "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> > news:O7ZTxp$KEHA.2244@.tk2msftngp13.phx.gbl...
> > > I already solved this problem.
> > > > > "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> > > news:upQn0K$KEHA.628@.TK2MSFTNGP11.phx.gbl...
> > > > Hi
> > > > I have a ListBox control in my ASP.NET page. After I binding data to
> > this
> > > > control, I would like to be able to change this display order of
items
> > in
> > > > this control. Just like change layout function of my.yahoo.com.
> > > > I tried client side approach, yes I can change display order by
> > > JavaScript,
> > > > but after clicking one of the button the display order will reverse
> back
> > > to
> > > > its original status. Because after PostBack, the page will try to
> render
> > > > this control by viewstate again.
> > > > > > I tried server side approach, but looks there is no way to switch
two
> > > > ListItems programmatically.
> > > > > > > > Is there anybody who has some good idea?
> > > > > > Thanks!
> > > > > > --
> > > > > > > > > > WWW: http://hardywang.1accesshost.com
> > > > ICQ: 3359839
> > > > yours Hardy
> > > > > >

set dropdownlist selectedindex in datagrid

Hi all,

I have a datagrid with a dropdownlist and would like to have the
dropdownlist display a database value correctly while the grid is in
edit mode.

I have a templatecolumn as follows:

<asp:TemplateColumn HeaderText="New Route">
<HeaderStyle Width="0.5in"></HeaderStyle>
<ItemTemplate>
<asp:DropDownList id="DropDownList3" runat="server"
AutoPostBack="True" OnSelectedIndexChanged="ddlselect">
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="B">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
<asp:ListItem Value="D">D</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>

with an edit column as:
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update"
HeaderText="Edit" CancelText="Cancel" EditText="Edit"></
asp:EditCommandColumn>

I would like to set the dropdownlist to the value found in the
database. my code behind uses ItemDataBound as follows:

public void myDataGrid_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
DropDownList dd;
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
dd = (DropDownList)e.Item.Cells[7].FindControl("DropDownList3");
dd.SelectedIndex =
dd.Items.IndexOf(dd.Items.FindByText(e.Item.Cells[3].Text));
}
}

upon loading the dropdownlist has the values as in the database.
However, when I press edit the selected index becomes 0. I cannot
figure how to set the value correctly.

my edit code looks like:
public void myDataGrid_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DropDownList dd;
dd = (DropDownList)e.Item.Cells[7].FindControl("DropDownList3");
dd.SelectedIndex =
dd.Items.IndexOf(dd.Items.FindByText(e.Item.Cells[3].Text));
<-- dd.SelectedIndex looks fine here -->
...
}

dd.SelectedIndex looks ok in debug mode, but something changes it
before the dropdownlist is displayed. the values in the dropdownlists
not being edited are ok, it's only the one being edited that shows the
wrong selectedindex.

any help would be appreciated. thanks.pleaseexplaintome@.yahoo.com wrote:

Quote:

Originally Posted by

Hi all,
>
I have a datagrid with a dropdownlist and would like to have the
dropdownlist display a database value correctly while the grid is in
edit mode.
>
I have a templatecolumn as follows:
>
<asp:TemplateColumn HeaderText="New Route">
<HeaderStyle Width="0.5in"></HeaderStyle>
<ItemTemplate>
<asp:DropDownList id="DropDownList3" runat="server"
AutoPostBack="True" OnSelectedIndexChanged="ddlselect">
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="B">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
<asp:ListItem Value="D">D</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>


There is a much easier way (at least in ASP.NET 2.0)

Set the property SelectedValue on the DrowDownlist
declaratively like this:

SelectedValue='<%# Bind("myDBField") %>'

This will take care of everything: showing the data and
updating the data after postback.

--

Riki

set dropdownlist selectedindex in datagrid

Hi all,
I have a datagrid with a dropdownlist and would like to have the
dropdownlist display a database value correctly while the grid is in
edit mode.
I have a templatecolumn as follows:
<asp:TemplateColumn HeaderText="New Route">
<HeaderStyle Width="0.5in"></HeaderStyle>
<ItemTemplate>
<asp:DropDownList id="DropDownList3" runat="server"
AutoPostBack="True" OnSelectedIndexChanged="ddlselect">
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="B">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
<asp:ListItem Value="D">D</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
with an edit column as:
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update"
HeaderText="Edit" CancelText="Cancel" EditText="Edit"></
asp:EditCommandColumn>
I would like to set the dropdownlist to the value found in the
database. my code behind uses ItemDataBound as follows:
public void myDataGrid_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
DropDownList dd;
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
dd = (DropDownList)e.Item.Cells[7].FindControl("DropDownList3");
dd.SelectedIndex =
dd.Items.IndexOf(dd.Items.FindByText(e.Item.Cells[3].Text));
}
}
upon loading the dropdownlist has the values as in the database.
However, when I press edit the selected index becomes 0. I cannot
figure how to set the value correctly.
my edit code looks like:
public void myDataGrid_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DropDownList dd;
dd = (DropDownList)e.Item.Cells[7].FindControl("DropDownList3");
dd.SelectedIndex =
dd.Items.IndexOf(dd.Items.FindByText(e.Item.Cells[3].Text));
<-- dd.SelectedIndex looks fine here -->
...
}
dd.SelectedIndex looks ok in debug mode, but something changes it
before the dropdownlist is displayed. the values in the dropdownlists
not being edited are ok, it's only the one being edited that shows the
wrong selectedindex.
any help would be appreciated. thanks.pleaseexplaintome@.yahoo.com wrote:
> Hi all,
> I have a datagrid with a dropdownlist and would like to have the
> dropdownlist display a database value correctly while the grid is in
> edit mode.
> I have a templatecolumn as follows:
> <asp:TemplateColumn HeaderText="New Route">
> <HeaderStyle Width="0.5in"></HeaderStyle>
> <ItemTemplate>
> <asp:DropDownList id="DropDownList3" runat="server"
> AutoPostBack="True" OnSelectedIndexChanged="ddlselect">
> <asp:ListItem Value="A">A</asp:ListItem>
> <asp:ListItem Value="B">B</asp:ListItem>
> <asp:ListItem Value="C">C</asp:ListItem>
> <asp:ListItem Value="D">D</asp:ListItem>
> </asp:DropDownList>
> </ItemTemplate>
There is a much easier way (at least in ASP.NET 2.0)
Set the property SelectedValue on the DrowDownlist
declaratively like this:
SelectedValue='<%# Bind("myDBField") %>'
This will take care of everything: showing the data and
updating the data after postback.
Riki

Thursday, March 22, 2012

Set formatting (color) on a literal or label

We have a status message we display that can be good news (in green) or bad
news (in red). Is there a way to do this for a single literal or label? Or do
we need to have two, one set to green and one to red and just set one to a
text string and the other to ""?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.comDim GoodNews as Boolean
....
If GoodNews Then
MessageLabel.Font.Color = Color.Green
Else
MessageLabel.Font.Color = Color.Red
End If

"David Thielen" <thielen@.nospam.nospam> wrote in message
news:5D81CB86-10F8-471F-A5E7-00E187DABF4B@.microsoft.com...
> We have a status message we display that can be good news (in green) or
> bad
> news (in red). Is there a way to do this for a single literal or label? Or
> do
> we need to have two, one set to green and one to red and just set one to a
> text string and the other to ""?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
If you do it using a Literal you can set the Text property to the complete
markup e.g.
If GoodNews Then
Literal1.Text = "<span class='greencolorCss'>this is the status
for good news </span>"
Else
Literal1.Text = "<span class='redcolorCss'>this is the status
for bad news </span>"
End If

If you do it using a Label you might write:
If GoodNews Then
Label1.CssClass = "greencolorCss"
Label1.Text = "This is the status for good news"

Else
Label1.CssClass = "redcolorCss"
Label1.Text = "This is the status for bad news"
End If
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

"David Thielen" wrote:

> We have a status message we display that can be good news (in green) or bad
> news (in red). Is there a way to do this for a single literal or label? Or do
> we need to have two, one set to green and one to red and just set one to a
> text string and the other to ""?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com

set image url programmatically for image control

I have a print page that uses an image control to display an image that is saved in a directory that is dynamically created upon a session start. I have the path readily available for the image control...but I am failing to get the image to display in the image control...

what is the syntax to properly set the url for an image control programmatically in the code behind?

the control is named printImage

thanks in advance

Eric

printImage.src=


printImage.ImageUrl = "your URL";

simple as that.


I am not getting the .src in intellisense for the control - is there a namespace/directive that I am missing?


ekeefauver:

I am not getting the .src in intellisense for the control - is there a namespace/directive that I am missing?

Nope, it's just, that property is called "ImageUrl" and not "src".


doesn't seem to work for me...do I somehow need to refresh the control after setting the URL to the image?

the path to the image is: C:\Documents and Settings\dekeefau\My Documents\Visual Studio 2005\WebSites\CMAT_FINAL\sessions\sd_ewwewtjwy23b5vnrmxm1mffz\print\theimage.bmp

which is stored in a string variable


No, there is no need to refresh the control. Perhaps the path you are using is not valid? Try using Server.MapPath() function with the relative path to the image in question.

Example:

Image is in the /Images subfolder of the application and its name is MyImage.gif

Then the code to display this image would be:

printImage.ImageUrl = Server.MapPath("~/Images/MyImage.gif");

Set Meta Data from Code Behind

Can one set the page's Description and Keywords from the Code Behind?
I got a page that will display a company's information.
Depending on what company are loaded, I want to build the Keywords and Description MetaData dynamicallyASP.NET 1.1 or 2.0?
Oh, I think you use 1.1...

OK, you have your meta tags, as usual on your page. Add two attributes to it. An ID, and a runat="server" attribute. So you end up with something like

<meta name="keywords" content="default keywords" id="MetaKeywords1" runat="server"/>

Then in your codebehind, you should see MetaKeywords1 declared as an HtmlGenericControl control. If not, you should add it there because Visual Studio sometimes misses out on these things.

THEN, in the Page Load event,

MetaKeywords1.Attributes["content"] = "blah,blah2,blah3";
oooooh (stupid sounding ooooh)...easy like that.

Just been wondering...is it worth even setting the meta data for pages that are loaded in iFrames?

I mean, from the bit I read using meta data for search engine optimization are hardly worth it these days.

Thanks anyhow M. This thing say I give you too many reputations, and must spread the love first. Better stop that before I get redirected to gay sites or something.
(Thank you, thank you)

Yes, setting metadata is still helpful, especially when it comes to Google, the most important search engine out there. In fact, there are even SEO techniques out there that one ought to keep in mind. For example, in your <head> section, you ought to have the title first, and then description and then keywords and then any other meta tags you may have. And google does care about the meta keywords and description, so it's always worth setting it.

Set Metadata in code-behind

Can one set your page meta data in your code behind?
For instance, this one page can display any of many companies.
I want to add a keywords, and description fiield in the database for a company.
When this page load, I want to set the page's metadata to what is in the database..so i have to do it in my code behind.

Currently, I do something like this:
<meta content="Nico Nel (Accuracy Automotive)" name="author">
<meta content="nico@dotnet.itags.org.accuracyauto.com" name="reply-to">
<% if (Language == "ja-JP") {%>
<meta content="Japanese Description." name="description">
<meta content="Japanese Keywords" name="keywords">
<LINK href="http://links.10026.com/?link=styles/style_ja.css" type="text/css" rel="stylesheet">
<%} else if (Language == "en-US") {%>
<meta content="English Description." name="description">
<meta content="English Keywords" name="keywords">
<LINK href="http://links.10026.com/?link=styles/style_en.css" type="text/css" rel="stylesheet">
<%} else {%>
<meta content="Chinese Description." name="description">
<meta content="Chinese Keywords" name="keywords">
<LINK href="http://links.10026.com/?link=styles/style_zh.css" type="text/css" rel="stylesheet">
<%}%>Set each of the <meta> tags to runat=server.
Give them an ID.

You can now access them from your codebehind.
Just like any control.
cool..thanks M.
Hmmm...as what do one declare them variables in your code?
(you know..like a table cell would be protected htlmtablecell mycell;)