Thursday, March 22, 2012
Set href for <link tag
for my pages. I thought I saw code using the asp:placeholder to give the
code-behind a place to update the html control with a specific href setting.
Any ideas?
ThanksThis sets technique sets the Title programmatically but you might be able to
rejig it to do a <link>
http://authors.aspalliance.com/kenc/faq5.aspx
"Robert Strickland" <bstrickland@.comporium.net> wrote in message
news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
>I need to dynamically set the href attribute for the <link> tag at run time
> for my pages. I thought I saw code using the asp:placeholder to give the
> code-behind a place to update the html control with a specific href
> setting.
> Any ideas?
> Thanks
>
Hi,
Give the <link> tag id="lnk" (can be anything) and runat=server attributes.
From code-behind, use the Attributes property, like normal server-side
controls, to add attribute values:
lnk.Attributes.Add ("rel", "stylesheet")
lnk.Attributes.Add ("href", "primary.css")
HTH.
"Robert Strickland" <bstrickland@.comporium.net> wrote in message
news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
I need to dynamically set the href attribute for the <link> tag at run time
for my pages. I thought I saw code using the asp:placeholder to give the
code-behind a place to update the html control with a specific href setting.
Any ideas?
Thanks
thanks
"Shiva" <shiva_sm@.online.excite.com> wrote in message
news:#SjXjlliEHA.356@.tk2msftngp13.phx.gbl...
> Hi,
> Give the <link> tag id="lnk" (can be anything) and runat=server
attributes.
> From code-behind, use the Attributes property, like normal server-side
> controls, to add attribute values:
> lnk.Attributes.Add ("rel", "stylesheet")
> lnk.Attributes.Add ("href", "primary.css")
> HTH.
> "Robert Strickland" <bstrickland@.comporium.net> wrote in message
> news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
> I need to dynamically set the href attribute for the <link> tag at run
time
> for my pages. I thought I saw code using the asp:placeholder to give the
> code-behind a place to update the html control with a specific href
setting.
> Any ideas?
> Thanks
>
>
Thanks
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:#TdPDLliEHA.636@.TK2MSFTNGP12.phx.gbl...
> This sets technique sets the Title programmatically but you might be able
to
> rejig it to do a <link>
> http://authors.aspalliance.com/kenc/faq5.aspx
> "Robert Strickland" <bstrickland@.comporium.net> wrote in message
> news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
time
>
Set href for <link tag
for my pages. I thought I saw code using the asp:placeholder to give the
code-behind a place to update the html control with a specific href setting.
Any ideas?
ThanksThis sets technique sets the Title programmatically but you might be able to
rejig it to do a <link
http://authors.aspalliance.com/kenc/faq5.aspx
"Robert Strickland" <bstrickland@.comporium.net> wrote in message
news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
>I need to dynamically set the href attribute for the <link> tag at run time
> for my pages. I thought I saw code using the asp:placeholder to give the
> code-behind a place to update the html control with a specific href
> setting.
> Any ideas?
> Thanks
Hi,
Give the <link> tag id="lnk" (can be anything) and runat=server attributes.
From code-behind, use the Attributes property, like normal server-side
controls, to add attribute values:
lnk.Attributes.Add ("rel", "stylesheet")
lnk.Attributes.Add ("href", "primary.css")
HTH.
"Robert Strickland" <bstrickland@.comporium.net> wrote in message
news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
I need to dynamically set the href attribute for the <link> tag at run time
for my pages. I thought I saw code using the asp:placeholder to give the
code-behind a place to update the html control with a specific href setting.
Any ideas?
Thanks
Thanks
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:#TdPDLliEHA.636@.TK2MSFTNGP12.phx.gbl...
> This sets technique sets the Title programmatically but you might be able
to
> rejig it to do a <link>
> http://authors.aspalliance.com/kenc/faq5.aspx
> "Robert Strickland" <bstrickland@.comporium.net> wrote in message
> news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
> >I need to dynamically set the href attribute for the <link> tag at run
time
> > for my pages. I thought I saw code using the asp:placeholder to give the
> > code-behind a place to update the html control with a specific href
> > setting.
> > Any ideas?
> > Thanks
thanks
"Shiva" <shiva_sm@.online.excite.com> wrote in message
news:#SjXjlliEHA.356@.tk2msftngp13.phx.gbl...
> Hi,
> Give the <link> tag id="lnk" (can be anything) and runat=server
attributes.
> From code-behind, use the Attributes property, like normal server-side
> controls, to add attribute values:
> lnk.Attributes.Add ("rel", "stylesheet")
> lnk.Attributes.Add ("href", "primary.css")
> HTH.
> "Robert Strickland" <bstrickland@.comporium.net> wrote in message
> news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
> I need to dynamically set the href attribute for the <link> tag at run
time
> for my pages. I thought I saw code using the asp:placeholder to give the
> code-behind a place to update the html control with a specific href
setting.
> Any ideas?
> Thanks
Set html table width at run time (in code)
How can I get a html control in my code?
I have a html table that I want the width is defined in code at run time,
i.e., I have this table and I have a datagrid. This datagrid have a variable
width because the number of columns depends of something that I have (that
is not important for this). Now, what I want is that the html table have
always the same width of my datagrid because of alignment of both.
NOTE: I must have (and want) the datagrid width variable and not fixed
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
rucaset its attribute runat=server, but you'll probably still have problems
while tables align width depending on its content... You can hardly create
different tables with same width. The only chance is when content never
exceedes desired table (or better said cell) width.
RobertK
{ Clever? No just smart. }
"ruca" <ruuca@.iol.pt> wrote in message
news:e4d176wbEHA.3148@.TK2MSFTNGP10.phx.gbl...
> Hi
> How can I get a html control in my code?
> I have a html table that I want the width is defined in code at run time,
> i.e., I have this table and I have a datagrid. This datagrid have a
variable
> width because the number of columns depends of something that I have (that
> is not important for this). Now, what I want is that the html table have
> always the same width of my datagrid because of alignment of both.
> NOTE: I must have (and want) the datagrid width variable and not fixed
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
Thanks
Now, how can I get the widht value at run time of a datagrid?
I have this:
Dim dgPx As Unit
dgPx = myDataGrid.Width()
But dgPx.Value does not have the value of the grid after binding grid.
Can you help?
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Robert Koritnik" <robert.koritnik.removethis@.avtenta.si> escreveu na
mensagem news:%23hnurAxbEHA.2816@.TK2MSFTNGP11.phx.gbl...
> set its attribute runat=server, but you'll probably still have problems
> while tables align width depending on its content... You can hardly create
> different tables with same width. The only chance is when content never
> exceedes desired table (or better said cell) width.
> --
> RobertK
> { Clever? No just smart. }
> "ruca" <ruuca@.iol.pt> wrote in message
> news:e4d176wbEHA.3148@.TK2MSFTNGP10.phx.gbl...
time,
> variable
(that
>
You will have to set that. I told you in my first answer this is a tough
one. The best suggestion I could give you is to put both (table and
Datagrid) inside another table set both control's width to 100%. They would
perfectly align and everything will depend on the width of the containing
table cell.
And you probably won't have to wory about widths of both parts of the
page... Or better said tables, while a datagris is also a table.
RobertK
{ Clever? No just smart. }
"ruca" <ruuca@.iol.pt> wrote in message
news:ekMCZTxbEHA.1048@.tk2msftngp13.phx.gbl...
> Thanks
> Now, how can I get the widht value at run time of a datagrid?
> I have this:
> Dim dgPx As Unit
> dgPx = myDataGrid.Width()
> But dgPx.Value does not have the value of the grid after binding grid.
> Can you help?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
> "Robert Koritnik" <robert.koritnik.removethis@.avtenta.si> escreveu na
> mensagem news:%23hnurAxbEHA.2816@.TK2MSFTNGP11.phx.gbl...
create
> time,
> (that
have
>
One doesn't do this sort of things in the code. Put both the table and the
grid in another table as it's been suggested in another reply.
Eliyahu
"ruca" <ruuca@.iol.pt> wrote in message
news:e4d176wbEHA.3148@.TK2MSFTNGP10.phx.gbl...
> Hi
> How can I get a html control in my code?
> I have a html table that I want the width is defined in code at run time,
> i.e., I have this table and I have a datagrid. This datagrid have a
variable
> width because the number of columns depends of something that I have (that
> is not important for this). Now, what I want is that the html table have
> always the same width of my datagrid because of alignment of both.
> NOTE: I must have (and want) the datagrid width variable and not fixed
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
Set html table width at run time (in code)
How can I get a html control in my code?
I have a html table that I want the width is defined in code at run time,
i.e., I have this table and I have a datagrid. This datagrid have a variable
width because the number of columns depends of something that I have (that
is not important for this). Now, what I want is that the html table have
always the same width of my datagrid because of alignment of both.
NOTE: I must have (and want) the datagrid width variable and not fixed
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
rucaset its attribute runat=server, but you'll probably still have problems
while tables align width depending on its content... You can hardly create
different tables with same width. The only chance is when content never
exceedes desired table (or better said cell) width.
--
RobertK
{ Clever? No just smart. }
"ruca" <ruuca@.iol.pt> wrote in message
news:e4d176wbEHA.3148@.TK2MSFTNGP10.phx.gbl...
> Hi
> How can I get a html control in my code?
> I have a html table that I want the width is defined in code at run time,
> i.e., I have this table and I have a datagrid. This datagrid have a
variable
> width because the number of columns depends of something that I have (that
> is not important for this). Now, what I want is that the html table have
> always the same width of my datagrid because of alignment of both.
> NOTE: I must have (and want) the datagrid width variable and not fixed
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
Thanks
Now, how can I get the widht value at run time of a datagrid?
I have this:
Dim dgPx As Unit
dgPx = myDataGrid.Width()
But dgPx.Value does not have the value of the grid after binding grid.
Can you help?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Robert Koritnik" <robert.koritnik.removethis@.avtenta.si> escreveu na
mensagem news:%23hnurAxbEHA.2816@.TK2MSFTNGP11.phx.gbl...
> set its attribute runat=server, but you'll probably still have problems
> while tables align width depending on its content... You can hardly create
> different tables with same width. The only chance is when content never
> exceedes desired table (or better said cell) width.
> --
> RobertK
> { Clever? No just smart. }
> "ruca" <ruuca@.iol.pt> wrote in message
> news:e4d176wbEHA.3148@.TK2MSFTNGP10.phx.gbl...
> > Hi
> > How can I get a html control in my code?
> > I have a html table that I want the width is defined in code at run
time,
> > i.e., I have this table and I have a datagrid. This datagrid have a
> variable
> > width because the number of columns depends of something that I have
(that
> > is not important for this). Now, what I want is that the html table have
> > always the same width of my datagrid because of alignment of both.
> > NOTE: I must have (and want) the datagrid width variable and not fixed
> > --
> > Programming ASP.NET with VB.NET
> > Thank's (if you try to help me)
> > Hope this help you (if I try to help you)
> > ruca
You will have to set that. I told you in my first answer this is a tough
one. The best suggestion I could give you is to put both (table and
Datagrid) inside another table set both control's width to 100%. They would
perfectly align and everything will depend on the width of the containing
table cell.
And you probably won't have to wory about widths of both parts of the
page... Or better said tables, while a datagris is also a table.
--
RobertK
{ Clever? No just smart. }
"ruca" <ruuca@.iol.pt> wrote in message
news:ekMCZTxbEHA.1048@.tk2msftngp13.phx.gbl...
> Thanks
> Now, how can I get the widht value at run time of a datagrid?
> I have this:
> Dim dgPx As Unit
> dgPx = myDataGrid.Width()
> But dgPx.Value does not have the value of the grid after binding grid.
> Can you help?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
> "Robert Koritnik" <robert.koritnik.removethis@.avtenta.si> escreveu na
> mensagem news:%23hnurAxbEHA.2816@.TK2MSFTNGP11.phx.gbl...
> > set its attribute runat=server, but you'll probably still have problems
> > while tables align width depending on its content... You can hardly
create
> > different tables with same width. The only chance is when content never
> > exceedes desired table (or better said cell) width.
> > --
> > RobertK
> > { Clever? No just smart. }
> > "ruca" <ruuca@.iol.pt> wrote in message
> > news:e4d176wbEHA.3148@.TK2MSFTNGP10.phx.gbl...
> > > Hi
> > > > How can I get a html control in my code?
> > > I have a html table that I want the width is defined in code at run
> time,
> > > i.e., I have this table and I have a datagrid. This datagrid have a
> > variable
> > > width because the number of columns depends of something that I have
> (that
> > > is not important for this). Now, what I want is that the html table
have
> > > always the same width of my datagrid because of alignment of both.
> > > > NOTE: I must have (and want) the datagrid width variable and not fixed
> > > > > --
> > > Programming ASP.NET with VB.NET
> > > Thank's (if you try to help me)
> > > Hope this help you (if I try to help you)
> > > ruca
> >
One doesn't do this sort of things in the code. Put both the table and the
grid in another table as it's been suggested in another reply.
Eliyahu
"ruca" <ruuca@.iol.pt> wrote in message
news:e4d176wbEHA.3148@.TK2MSFTNGP10.phx.gbl...
> Hi
> How can I get a html control in my code?
> I have a html table that I want the width is defined in code at run time,
> i.e., I have this table and I have a datagrid. This datagrid have a
variable
> width because the number of columns depends of something that I have (that
> is not important for this). Now, what I want is that the html table have
> always the same width of my datagrid because of alignment of both.
> NOTE: I must have (and want) the datagrid width variable and not fixed
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
set index of drop downbox
I would like to set the selected item of drop downbox to the index of an
item that will only be known at run time.
I realise that if I were to know it at design time I could write
ddlResidentialCity.SelectedIndex = 3
however what I wish to do is say
ddlResidentialCity.SelectedIndex = Set to value of item who's text value is
"martin"
what I am unsure about is how to get the index of the item I wish to use as
the selected index
any help would be appreciated.
cheers
martinH
ddlResidentalCity.Items.FindByValue("martin").Selected = True
How about this?
ddlResidentialCity.SelectedValue = "martin"
"martin" <Stuart_REMOVE_36@.yahoo.com> wrote in message news:<#N9fYmwQEHA.132@.TK2MSFTNGP09.phx.gbl>...
> Hi,
> I would like to set the selected item of drop downbox to the index of an
> item that will only be known at run time.
> I realise that if I were to know it at design time I could write
> ddlResidentialCity.SelectedIndex = 3
> however what I wish to do is say
> ddlResidentialCity.SelectedIndex = Set to value of item who's text value is
> "martin"
> what I am unsure about is how to get the index of the item I wish to use as
> the selected index
>
> any help would be appreciated.
> cheers
> martin
set index of drop downbox
I would like to set the selected item of drop downbox to the index of an
item that will only be known at run time.
I realise that if I were to know it at design time I could write
ddlResidentialCity.SelectedIndex = 3
however what I wish to do is say
ddlResidentialCity.SelectedIndex = Set to value of item who's text value is
"martin"
what I am unsure about is how to get the index of the item I wish to use as
the selected index
any help would be appreciated.
cheers
martinHi
ddlResidentalCity.Items.FindByValue("martin").Selected = True
ddlResidentialCity.SelectedIndex = ddlResidentalCity.Items.IndexOf( ddlResid
entalCity.Items.FindByText("martin"))
How about this?
ddlResidentialCity.SelectedValue = "martin"
"martin" <Stuart_REMOVE_36@.yahoo.com> wrote in message news:<#N9fYmwQEHA.132@.TK2MSFTNGP09.p
hx.gbl>...
> Hi,
> I would like to set the selected item of drop downbox to the index of an
> item that will only be known at run time.
> I realise that if I were to know it at design time I could write
> ddlResidentialCity.SelectedIndex = 3
> however what I wish to do is say
> ddlResidentialCity.SelectedIndex = Set to value of item who's text value i
s
> "martin"
> what I am unsure about is how to get the index of the item I wish to use a
s
> the selected index
>
> any help would be appreciated.
> cheers
> martin