|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Master Pages session variablesto use session variables, but trying to access to the Request["formvalues"] is really difficult. <%@ Page Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="FirstPage.aspx.cs" Inherits="FirstPage" Title="First Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:DropDownList ID="podiumdropDown" runat="server"> <asp:ListItem Selected="True">No</asp:ListItem> <asp:ListItem>Yes</asp:ListItem> </asp:DropDownList> <asp:Button ID="Button1" runat="server" PostBackUrl="SecondPage.aspx" UseSubmitBehavior="False" /> </asp:Content1> on my second page i can't retrieve this value..... i get Request["podiumdropDown"].ToString(); is null!!!! SecondPage.aspx.cs protected void Page_Load(object sender, EventArgs e) { Session["podiumdropDown"] = Request["podiumdropDown"].ToString(); } You have to get the value from the DDL and then populate a Session variable
using that value. The value from the DDL doesn't jump into a Session variable all by itself. Furthermore, you probably don't even need to use a Session variable. <%= Clinton Gallagher Show quoteHide quote "VJ" <vnc***@hotmail.com> wrote in message news:%23h2eGgyMGHA.3264@TK2MSFTNGP11.phx.gbl... > I've created a handful of pages (with attached master files) and I want > to use session variables, but trying to access to the > Request["formvalues"] is really difficult. > > > <%@ Page Language="C#" MasterPageFile="MasterPage.master" > AutoEventWireup="true" CodeFile="FirstPage.aspx.cs" Inherits="FirstPage" > Title="First Page" %> > <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" > Runat="Server"> > > <asp:DropDownList ID="podiumdropDown" runat="server"> > <asp:ListItem Selected="True">No</asp:ListItem> > <asp:ListItem>Yes</asp:ListItem> > </asp:DropDownList> > <asp:Button ID="Button1" runat="server" PostBackUrl="SecondPage.aspx" > UseSubmitBehavior="False" /> > > </asp:Content1> > > > on my second page i can't retrieve this value..... > i get Request["podiumdropDown"].ToString(); is null!!!! > > SecondPage.aspx.cs > > protected void Page_Load(object sender, EventArgs e) > { > Session["podiumdropDown"] = Request["podiumdropDown"].ToString(); > > } > > -- > Sent via .NET Newsgroups > http://www.dotnetnewsgroups.com What is Request["poduimdropDown"]? Session variables use Session["<variable
name>"]. Are you looking to use Request.Form? -- Show quoteHide quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "VJ" <vnc***@hotmail.com> wrote in message news:%23h2eGgyMGHA.3264@TK2MSFTNGP11.phx.gbl... > I've created a handful of pages (with attached master files) and I want > to use session variables, but trying to access to the > Request["formvalues"] is really difficult. > > > <%@ Page Language="C#" MasterPageFile="MasterPage.master" > AutoEventWireup="true" CodeFile="FirstPage.aspx.cs" Inherits="FirstPage" > Title="First Page" %> > <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" > Runat="Server"> > > <asp:DropDownList ID="podiumdropDown" runat="server"> > <asp:ListItem Selected="True">No</asp:ListItem> > <asp:ListItem>Yes</asp:ListItem> > </asp:DropDownList> > <asp:Button ID="Button1" runat="server" PostBackUrl="SecondPage.aspx" > UseSubmitBehavior="False" /> > > </asp:Content1> > > > on my second page i can't retrieve this value..... > i get Request["podiumdropDown"].ToString(); is null!!!! > > SecondPage.aspx.cs > > protected void Page_Load(object sender, EventArgs e) > { > Session["podiumdropDown"] = Request["podiumdropDown"].ToString(); > > } > > -- > Sent via .NET Newsgroups > http://www.dotnetnewsgroups.com
Classic ASP String Manipulation - NOT .net
Server Side Custom Validation not running add a list item to a bound control Best way to have multiple pages show up as same selection on menu Simple String Conversion? Programatically Databinding controls within a Repeater DataGrid Conditional Formatting MaxLenth doesn't work My WebControls stopped working Populate dropdown/listbox |
|||||||||||||||||||||||