arielbf
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.mas ter" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Pliskin.Index" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="Head Content">
<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="Main Content">
<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:TextB ox>
<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.qu erystring( "uid")%>
2) To put that value as the value of the "username" variable -
<asp:TextBox ID="Username" runat="server" value="<%=request.querystr ing("uid") %>" disable></asp:TextBox>
When I try to change it - the file don't work anymore
<%@ Page Language="C#" MasterPageFile="~/Site.mas
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="Head
<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="Main
<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:
<br />
<asp:TextBox ID="Username" runat="server"></asp:TextB
<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.qu
2) To put that value as the value of the "username" variable -
<asp:TextBox ID="Username" runat="server" value="<%=request.querystr
When I try to change it - the file don't work anymore
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER