Hello,
I'm not sure if I'm in the right place to post this question, here's my pb:
I have a login.aspx.cs page where I get a value & pass it in the url, like this:
Response.Redirect("Welcome.aspx?group=" + group + "&user=" + Login1.UserName.ToString(), false);
Then in the Welcome.aspx page I have 3 links: ProjectManagement, SupplierManagement, OrderManagement. Some of them can be shown or hidden, according to the group that I got from the url, as shown:
<script runat="server">
protected void Page_Load(Object sender, EventArgs e)
{
string group = Request.Params["group"].ToString();
string user = Request.Params["user"].ToString();
if (group=="Admin")
{
AdminLink.Visible = true;
BuyerLink.Visible = true;
DemandeurLink.Visible = true;
}
else if (group=="Buyer")
{
AdminLink.Visible = false;
BuyerLink.Visible = true;
DemandeurLink.Visible = true;
}
else if (group == "Demandeur")
{
AdminLink.Visible = false;
BuyerLink.Visible = false;
DemandeurLink.Visible = true;
}
else
{
AdminLink.Visible = false;
BuyerLink.Visible = false;
DemandeurLink.Visible = false;
}
}
</script>
<asp:HyperLink id="DemandeurLink" runat="server"
Text="Gestion des commandes" NavigateUrl='<% "OrderManagement.aspx?group=" + Request.Params["group"]%>'/>
<asp:HyperLink id="BuyerLink" runat="server"
Text="Gestion des commandes" NavigateUrl='<% "SupplierManagement.aspx?group=" + Request.Params["group"]%>'/>
<asp:HyperLink id="AdminLink" runat="server"
Text="Gestion des commandes" NavigateUrl='<% "ProjectManagement.aspx?group=" + Request.Params["group"]%>'/>
It means that I want to transfer group variable twice: from the login page to the welcome page, and them from the welcome page to one of 3 links below. The pb is when I click on one of these 3 links, I do not have what I expected, but:
http://localhost/GDA/%3C%%20%22OrderManagement.aspx?group=%22%20+%20Request.Params[%22group%22]%%3E
What cause the pb? What have I done wrong?
I also tried (help from google):
NavigateUrl='<%#"OrderManagement.aspx?group=" & DataBinder.Eval(Container.DataItem, "group")%>'
but I got a compile error:
error CS: 'System.Web.UI.Page' does not have a definition for 'DataItem' and no 'DataItem' extension method accepting
the first argument with 'System.Web.UI.Page' type can be found (a directive or assembly reference missed?)
So, what should I do, please help!!!
Thanks,