i am adding a row in dataset , in which i want to add
(space chracter for html) and then want to bind
dataset to asp.net dropdown list box. But & automatically
converted to & chracter.
Is there any way by which can be retained as it is
when dropdown throws the html part.
THanksVikram:
you need to HtmlDecode
Do something like this:
public static string DecodedSpaces(int numberOfSpaces)
{
string spaces = "";
for (int i = 0; i <= numberOfSpaces; ++i)
{
spaces += " ";
}
return HttpUtility.HtmlDecode(spaces);
}
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Vikram" <anonymous@.discussions.microsoft.com> wrote in message
news:03ca01c515b8$25fef9c0$a501280a@.phx.gbl...
> i am adding a row in dataset , in which i want to add
> (space chracter for html) and then want to bind
> dataset to asp.net dropdown list box. But & automatically
> converted to & chracter.
> Is there any way by which can be retained as it is
> when dropdown throws the html part.
> THanks
Showing posts with label row. Show all posts
Showing posts with label row. Show all posts
Saturday, March 24, 2012
Passing   in drpdown dataset
i am adding a row in dataset , in which i want to add
(space chracter for html) and then want to bind
dataset to asp.net dropdown list box. But & automatically
converted to & chracter.
Is there any way by which can be retained as it is
when dropdown throws the html part.
(space chracter for html) and then want to bind
dataset to asp.net dropdown list box. But & automatically
converted to & chracter.
Is there any way by which can be retained as it is
when dropdown throws the html part.
THanksVikram:
you need to HtmlDecode
Do something like this:
public static string DecodedSpaces(int numberOfSpaces)
{
string spaces = "";
for (int i = 0; i <= numberOfSpaces; ++i)
{
spaces += " ";
}
return HttpUtility.HtmlDecode(spaces);
}
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Vikram" <anonymous@.discussions.microsoft.com> wrote in message
news:03ca01c515b8$25fef9c0$a501280a@.phx.gbl...
> i am adding a row in dataset , in which i want to add
> (space chracter for html) and then want to bind
> dataset to asp.net dropdown list box. But & automatically
> converted to & chracter.
> Is there any way by which can be retained as it is
> when dropdown throws the html part.
> THanks
Friday, March 16, 2012
Passing a variable in the onLoad event.
I have a data grid with multiple rows. Each row has a drop down box. I need
it to select the correct item for each row. What I am trying to figure out,
is can I pass a value to the onLoad event for the dropdownlist?
OnLoad="loadDefault(Container.DataItem("dropValue"))"Are you trying to put a selected index?
"Robin Bonin" <robin@.guavatools.com> wrote in message
news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> I have a data grid with multiple rows. Each row has a drop down box. I
need
> it to select the correct item for each row. What I am trying to figure
out,
> is can I pass a value to the onLoad event for the dropdownlist?
> OnLoad="loadDefault(Container.DataItem("dropValue"))"
I know the value of the selectedIndex, and that is what I'm trying to
select.
"Cristian Suazo" <crillus7@.hotmail.com> wrote in message
news:O$93Kq9SDHA.1724@.TK2MSFTNGP10.phx.gbl...
> Are you trying to put a selected index?
> "Robin Bonin" <robin@.guavatools.com> wrote in message
> news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> > I have a data grid with multiple rows. Each row has a drop down box. I
> need
> > it to select the correct item for each row. What I am trying to figure
> out,
> > is can I pass a value to the onLoad event for the dropdownlist?
> > OnLoad="loadDefault(Container.DataItem("dropValue"))"
Just set the selected index in the code behind: myDropDown.SelectedIndex =
intSelectedIndex
--
S. Justin Gengo, MCP
Web Developer / Programmer
Free Code Library At:
www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"Robin Bonin" <robin@.guavatools.com> wrote in message
news:foidna-hLOZ1JIiiXTWJjg@.eatel.net...
> I know the value of the selectedIndex, and that is what I'm trying to
> select.
>
> "Cristian Suazo" <crillus7@.hotmail.com> wrote in message
> news:O$93Kq9SDHA.1724@.TK2MSFTNGP10.phx.gbl...
> > Are you trying to put a selected index?
> > "Robin Bonin" <robin@.guavatools.com> wrote in message
> > news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> > > I have a data grid with multiple rows. Each row has a drop down box. I
> > need
> > > it to select the correct item for each row. What I am trying to figure
> > out,
> > > is can I pass a value to the onLoad event for the dropdownlist?
> > > > OnLoad="loadDefault(Container.DataItem("dropValue"))"
> >
it to select the correct item for each row. What I am trying to figure out,
is can I pass a value to the onLoad event for the dropdownlist?
OnLoad="loadDefault(Container.DataItem("dropValue"))"Are you trying to put a selected index?
"Robin Bonin" <robin@.guavatools.com> wrote in message
news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> I have a data grid with multiple rows. Each row has a drop down box. I
need
> it to select the correct item for each row. What I am trying to figure
out,
> is can I pass a value to the onLoad event for the dropdownlist?
> OnLoad="loadDefault(Container.DataItem("dropValue"))"
I know the value of the selectedIndex, and that is what I'm trying to
select.
"Cristian Suazo" <crillus7@.hotmail.com> wrote in message
news:O$93Kq9SDHA.1724@.TK2MSFTNGP10.phx.gbl...
> Are you trying to put a selected index?
> "Robin Bonin" <robin@.guavatools.com> wrote in message
> news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> > I have a data grid with multiple rows. Each row has a drop down box. I
> need
> > it to select the correct item for each row. What I am trying to figure
> out,
> > is can I pass a value to the onLoad event for the dropdownlist?
> > OnLoad="loadDefault(Container.DataItem("dropValue"))"
Just set the selected index in the code behind: myDropDown.SelectedIndex =
intSelectedIndex
--
S. Justin Gengo, MCP
Web Developer / Programmer
Free Code Library At:
www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"Robin Bonin" <robin@.guavatools.com> wrote in message
news:foidna-hLOZ1JIiiXTWJjg@.eatel.net...
> I know the value of the selectedIndex, and that is what I'm trying to
> select.
>
> "Cristian Suazo" <crillus7@.hotmail.com> wrote in message
> news:O$93Kq9SDHA.1724@.TK2MSFTNGP10.phx.gbl...
> > Are you trying to put a selected index?
> > "Robin Bonin" <robin@.guavatools.com> wrote in message
> > news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> > > I have a data grid with multiple rows. Each row has a drop down box. I
> > need
> > > it to select the correct item for each row. What I am trying to figure
> > out,
> > > is can I pass a value to the onLoad event for the dropdownlist?
> > > > OnLoad="loadDefault(Container.DataItem("dropValue"))"
> >
Subscribe to:
Posts (Atom)