Link to home
Start Free TrialLog in
Avatar of arielbf
arielbfFlag for Israel

asked on

session variables and request.querytring in .net

Usually I write in Classic ASP, but now I'm stuck with a .NET code i need to change:

<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Pliskin.Index" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
    .ltor
    {
          direction:rtl;
          overflow:hidden;
          resize: none;
    }
    .ltor:focus
    {
          outline: none;
    }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:Panel BackColor="#FFFFCC" runat="server" Width="410">
    <asp:TextBox BorderStyle="None" runat="server" ReadOnly="True" ID="Directions" TextMode="MultiLine" CssClass="ltor" Height="400" Width="400" Font-Size="X-Large" BackColor="#FFFFCC"></asp:TextBox>
    <br />
    <asp:TextBox ID="Username" runat="server"></asp:TextBox>
    <asp:Button runat="server" OnClick="Start" Text="Start" />
    </asp:Panel>
</asp:Content>

Now this code works - but I need it to include two additional things
1) To create a session variable -
<%session("id")=request.querystring("uid")%>

2) To put that value as the value of the "username" variable -
<asp:TextBox ID="Username" runat="server" value="<%=request.querystring("uid")%>" disable></asp:TextBox>

When I try to change it - the file don't work anymore
ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of arielbf

ASKER

Thank you