D
Debralous
What I want to do seems so simple, yet I can't figure it out! I have
a very simple aspx page that I'm displaying in an Iframe. The page
has three dropdown boxs and I this code on the aspx.cs to set three
variables to the selected text.
public partial class _Default : System.Web.UI.Page
{
public static string SelectedTopSector;
public static string SelectedSubSector;
public static string SelectedFinalSector;
protected void TopSector_SelectedIndexChanged(object sender,
EventArgs e)
{
SelectedTopSector = TopSector.SelectedItem.Text;
}
protected void SubSector_SelectedIndexChanged(object sender,
EventArgs e)
{
SelectedSubSector = SubSector.SelectedItem.Text;
}
protected void FinalSector_SelectedIndexChanged(object sender,
EventArgs e)
{
SelectedFinalSector = FinalSector.SelectedItem.Text;
}
}
I want to access these variables from javascript in order to pass the
values back to my parent form. My code is correct (see below) for
passing the variable back as I can pass static values, but I cannot
seem to figure out how to get pass the variables from the C# code.
<script type="text/javascript" language="javascript">
// Assign back to the form
parent.document.forms[0].all.topsector.DataValue =
SelectedTopSector;
parent.document.forms[0].all.subsector.DataValue =
SelectedSubSector;
parent.document.forms[0].all.finalsector.DataValue =
SelectedFinalSector;
</script>
PLEASE PLEASE PLEASE if someone could help me understand what I'm
missing I would appreciate it tremendously!!
Debra
a very simple aspx page that I'm displaying in an Iframe. The page
has three dropdown boxs and I this code on the aspx.cs to set three
variables to the selected text.
public partial class _Default : System.Web.UI.Page
{
public static string SelectedTopSector;
public static string SelectedSubSector;
public static string SelectedFinalSector;
protected void TopSector_SelectedIndexChanged(object sender,
EventArgs e)
{
SelectedTopSector = TopSector.SelectedItem.Text;
}
protected void SubSector_SelectedIndexChanged(object sender,
EventArgs e)
{
SelectedSubSector = SubSector.SelectedItem.Text;
}
protected void FinalSector_SelectedIndexChanged(object sender,
EventArgs e)
{
SelectedFinalSector = FinalSector.SelectedItem.Text;
}
}
I want to access these variables from javascript in order to pass the
values back to my parent form. My code is correct (see below) for
passing the variable back as I can pass static values, but I cannot
seem to figure out how to get pass the variables from the C# code.
<script type="text/javascript" language="javascript">
// Assign back to the form
parent.document.forms[0].all.topsector.DataValue =
SelectedTopSector;
parent.document.forms[0].all.subsector.DataValue =
SelectedSubSector;
parent.document.forms[0].all.finalsector.DataValue =
SelectedFinalSector;
</script>
PLEASE PLEASE PLEASE if someone could help me understand what I'm
missing I would appreciate it tremendously!!
Debra