Hi,
I would like to use a session variable to be able to control what to retrieve in the database :use nomfr instead of nomen depending on Request.UserLanguages[0] value.
But sometimes it works and sometimes not. Here's my source:
}
And i use a databinder to retrieve "[nom"+Session["lg"]+"]".
Sometimes under IE it works but not in Firefox and sometimes it works in both....[:|]
Here is what i get:
Server Error in '/' Application.
nom is neither a DataColumn nor a DataRelation for table chapitres.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: nom is neither a DataColumn nor a DataRelation for table chapitres.
Source Error:
Line 89: <asp:Repeater id="leftmenucontent" Runat="server"> Line 90: <ItemTemplate> Line 91: <a href="<%# DataBinder.Eval(Container.DataItem, "nomurl")+".html"%>" class="leftmenuchapitreselect"> <img src="images/interface/fleche_horizon.gif" width="9" height="7" class="imagenoborder" alt="-" /> <%# DataBinder.Eval(Container.DataItem,"[nom"+Session["lg"]+"]")%></a> Line 92: <div class="leftmenutitrefond"> Line 93: <asp:Repeater ID="menutitres" datasource='<%#DataBinder.Eval(Container.DataItem, "linktitrechap")%>' Runat="server" >
ddeltgen
Member
130 Points
26 Posts
Using Session variables with database info picking
Apr 11, 2005 09:20 AM|LINK
I would like to use a session variable to be able to control what to retrieve in the database :use nomfr instead of nomen depending on Request.UserLanguages[0] value.
But sometimes it works and sometimes not. Here's my source:
if (Request.UserLanguages[0] == "fr")
{
Session["lg"] = "fr";
}
else
{
Session["lg"] = "en";
}
And i use a databinder to retrieve "[nom"+Session["lg"]+"]".
Sometimes under IE it works but not in Firefox and sometimes it works in both....[:|]
Here is what i get:
Server Error in '/' Application.
nom is neither a DataColumn nor a DataRelation for table chapitres.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.ArgumentException: nom is neither a DataColumn nor a DataRelation for table chapitres.
Source Error: