Pass Session Values To A Subdomain In .net?

Jun 17, 2010

I would like to know the method of passing session variables/values to a subdomain from the main website.For eg : Upon user login, I would like to set some session variables and redirect the page to a subdomain URL.

How can this be done? fyi... I have setup two websites in IIS. One is localhost and the other is subdomain.localhost

So, If I want to retrieve the session values in subdomain.localhost (which points to a specific folder in the app), how should I go about it?

View 2 Replies


Similar Messages:

Crystal Reports :: How To Pass Session Values As Parameters

Apr 16, 2013

i want to show a crystel report on page load of page. where i want to show report of those student who logged in the system and their session is created.

View 1 Replies

Data Controls :: Pass GridView Row Values Using Session

May 7, 2015

This is my UserRoleList.aspx file:

<%@ Page Title="" Language="C#" MasterPageFile="~/Forms/RolesMgt/MasterRoles.master"
AutoEventWireup="true" CodeFile="UserRoleList.aspx.cs" Inherits="Forms_RolesMgt_RoleList_UserRoleList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

[Code] ....

This is the UserRoleList.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

[Code] ....

This is the next page where i want all the controls of the selected row to be transferred. I tried by out ur different tutorial, it works when i use out of my project but did not work when i use it in my working project.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

[Code] ....

I tried the tutorials as u mentioned above but showing the same error.

View 1 Replies

Data Controls :: Pass GridView Row Values To Next Page Using Session?

Mar 22, 2013

i have a gridview with link button and one field called "ID"

if i click that link button that "Id" values should pass to next page using "SESSION" variable in vb.net

View 1 Replies

State Management :: Pass Multiple Selected Checkbox Values To Another Page With Session?

Nov 23, 2010

i want to pass multiple selected checkbox values to another page with session.

[Code]....

Second Page...

View 10 Replies

Data Controls :: Send (Pass) GridView Row Values To Next Page Using Session Variable

Nov 6, 2013

i have a gridview with link button and one field called "ID" i have five values....when i click the link button that row value ill show in next page in textboxes ,txtid, txtage, txtsalary,......... if i click that link button that "Id" values should pass to next page using "SESSION" variable in C#.net

View 1 Replies

Subdomain - Sharing Session Data Between Domains In Asp

Jun 3, 2010

i want to maintain session data between two applications or domains [URL]. I have read on net about this, but many people pointing many different ways to do it, with people commenting +ve and -ve responses to all. Plus many are just providing theoretical answer, do this and that ,but no code at all. are these steps all that is required?

1) in web.config: <httpCookies domain=".[URL]"/>

2) store session data in sql DB as:(after preparing the db for storing sessions)

<sessionState mode="SQLServer" sqlConnectionString="Data Source=YourServer;
Integrated Security=True;database=MySessionDB" sqlCommandTimeout="30"
allowCustomSqlDatabase="true"/>
<machineKey decryption="AES" validation="SHA1" decryptionKey="..." validationKey="..." />

3)Am confused about this one: i want to set the domain for the session cookie like this

Response.Cookies["ASP.NET_SessionId"].Domain = ".[URL]";
But where should this code be written?
this entry: [URL]says: use System.Web.SessionState.SessionIDManager as a base class but the SaveSessionID method is not virtual so cannot be overridden. Options are: either explicitly re-implement the interface method or decorate SessionIDManager class and after calling SessionIDManager.SaveSessionID set Response.Cookies[SessionIdCookieName].Domain to our domain.

Only if the author had provided real code, step 3 would have been clear. Plus all this 3 steps enough to share session among the domains?

View 1 Replies

Web Forms :: How To Maintain Session Between Domain And Subdomain

Dec 7, 2012

how can i maintain session between domain and subdomains.

i have a master page in my domain say [URL] which collects username and then i redirect it to subdomain.mydomain.com, then how can i retrieve the value from the session in the subdomain Master page.

View 1 Replies

Web Forms :: Store Values In Session Array And Get Back The Values From Session ?

Oct 1, 2010

i have two text boxes and one button in web form. I need to display the contents of text boxes in a datatable in the same form, when i click on the button.

How can i do this using session array. I need to store values in session array. and get back the values from session when i need .

View 2 Replies

Redirect Subdomain To Subfolder Of Another Subdomain?

Nov 15, 2010

What I want to do is take traffic that is going to shop.mywebsite.com and redirect or rewrite (I'm not sure of the terminology) the domain to be www.mywebsite.com/shop. Both shop.* and www.* are separate web applications (nopCommerce and Umbraco respectively) that don't seem to cooperate when I've tried to nest them. Both applications are in a Server 2008 R2/IIS 7.5 environment.

I've searched around stackoverflow and what I've found is a lot of answers to mapping the other direction (ie subfolder to a subdomain) but that's not what I'm looking for as far as I understand the problem.

The end goal is to combine the SEO reputation of the shop subdomain into the www subdomain. I readily admit that I might have this all backwards and am willing to try any suggestions I'm offered.

View 1 Replies

Subdomain Cookie (parent And One Subdomain)

Jan 31, 2010

I have an app with multiple subdomains, subone.parent.com, subtwo.parent.com.

I have a logon page at parent.com/login. When a user logs in I redirect them to the proper domain based on which one they are a member of. This works fine.

FormsAuthenticationTicket ticket = new FormsAuth...
string encTicket = FormsAuthentication.Encrypt(ticket);
var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);
cookie.Domain = subone.parent.com
Repsonse.Cookies.Add(cookie)

This properly authenticates the user for subone.parent.com and not subtwo.parent.com. However I would like to do the following.

If the user goes back to parent.com, I would like to know that they are logged in and redirect them back to subone.parent.com.

Is there a best practice for accomplishing this? Or do I have to set another cookie for parent.com?

I'm working in asp.net mvc if it matters.

View 3 Replies

How To Pass Session Id From One Page To Another

Feb 22, 2010

I am using a datagridview. I am using a command field & want to pass a session id (which is stored in database) from one page to another as I click on the command field link.

View 2 Replies

How To Pass Session Value Through Hyperlink

May 3, 2012

How to pass session value through Hyperlink in asp.net in i have the textbox value in 1st page,if am given textbox then click the hyperlink  i need the 1st page textbox value

View 1 Replies

Using Session To Pass Data Between Forms?

Aug 22, 2010

In my app, I am displaying an Rss Feed, I have a button that takes the user to another form where they can select a them. Upon selecting the theme, they are taken back to the original form.

If the user has selected which theme they want to view then they click on the button to change theme, I need to pass the information about what rss feed they were viewing through session so that once they select the theme they want they are redirected back to the main page and the rss feed they were viewing should still be displayed.

Since I've already bound the data to the xmlDataSource and DataList I am trying the following:

Session.Add("CurrentRssFeed", XmlDataSource1.DataFile);
Session.Add("CurrentDataList", DataList1);

I'm not sure I am passing the data over correctly and I'm not sure how to specify it in the page_preinit.

View 1 Replies

State Management :: Pass Session From Vb To C#?

Jun 11, 2010

i just want to know..is it possible to me to pass session from VB to C#..??

my friend write website using vb for user to login..and after login..the program will redirect to my website which is write in c#...is it possible to get session data from VB..??

i have write this code..but cannot pass the sesion data..

code from VB

If (Username.Text = userID And password.Text = userPassword) Then
FormsAuthentication.RedirectFromLoginPage(Username.Text, True)
Session("OperID") = Username.Text

my program in c#

if (!Page.IsPostBack)
{
string OpenID = Session["OperID"].ToString();
welcome.Text = "Hello, " + OpenID;
}

View 7 Replies

Ajax - Pass Session Variables To A Hyperlink?

Mar 3, 2011

finding " how to pass sesion variables to a hyperlink in asp.net "

View 3 Replies

DataSource Controls :: Pass Session Parameters To Sql?

May 2, 2010

How I can Pass session parameters to sqlDataSource. I do like this but it is not work:

[Code]....

The session name is :session["EmailAddress"]

View 2 Replies

Pass Values From One Page To Another?

Mar 17, 2010

i have one scenario in which i have to pass values from one page to another for that currently i am using querystring but now the values are more so i want to remove querystring and i dont want to user session as well and so i have tried using Hiddenfields but after redirecting to another page the values are cleared from all the hidden fields.

View 14 Replies

How To Pass Values Between ASCX

Feb 14, 2010

How to pass values between ASCX ?/

View 1 Replies

How To Pass Values To The Web Service

Jan 27, 2010

I would like to discuse with u, now i have one problem, ie, how could i pass value from the code behind to the web service, in that ,i have to pass 3 values,1, context key2, prefix text3, dropdown selected text or value, ( Contains Designation Details)how could i pass this 3rd value

View 1 Replies

ADO.NET :: Can't Pass DataReader Values

Nov 1, 2010

Why can I not call the global variables CatCode and CompanyName which are equated in the first procedure GetCompanyCatID And use their new values in the second procedure UpdateCompanyCounts as parameter values. When I hard code them code their values at the end of the GetCompany CatID procedure the following procedure updates properly.

string CatCode; - delcared global
string CompanyName; - delcared global
protected void GetCompanyCatID()
{
LinkID2 = Request.QueryString["linkid"].ToString();
string L_ID = LinkID2;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString001"].ConnectionString);
SqlCommand cmd = new SqlCommand("GetCID", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@L_ID", L_ID);
try
{
con.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
if (reader["CG_ID"] != System.DBNull.Value)
CatCode = (string)reader["CG_ID"];
CompanyName = (string)reader["CG_Name"];
}
}
}
catch (SqlException exc)
{ }
finally
{ con.Close(); }
// ******* HARD CODED to test below update procedure, it works. When commented out the following update procedure does not update.
CatCode = "55555"
CompanyName = "Test";
UpdateCompanyCounts();
}
protected void UpdateCompanyCounts()
{
LinkID2 = Request.QueryString["linkid"].ToString();
string L_ID = LinkID2;
string CatCode2 = CatCode;
string CompanyName2 = CompanyName;
// string CatCode2 = "23456";
// string CompanyName2 = "TEST";
SqlConnection con2 = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString001"].ConnectionString);
SqlCommand cmd2 = new SqlCommand("UpdateCatCounter", con2);
cmd2.CommandType = CommandType.StoredProcedure;
cmd2.Parameters.AddWithValue("@L_ID", LinkID2);
cmd2.Parameters.AddWithValue("@CG_ID", CatCode2 );
cmd2.Parameters.AddWithValue("@CG_Name", CompanyName2 );
try
{
con2.Open();
cmd2.ExecuteNonQuery();
}
catch (SqlException exc)
{
// ErrorBox.Text += string.Format("Error: {0}<br/>", exc.Message);
}
finally
{
con2.Close();
}
}

View 5 Replies

C# - Pass Values To Other Pages?

May 5, 2010

i am trying here is to pass values to other pages. When i include the following code

private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm5.aspx?Name="+txtName.Text);

[code]...

View 3 Replies

DataSource Controls :: How To Pass Session UserName In Where Clause In Sql

Feb 28, 2010

SELECT DISTINCT TblSections.SectionID, TblSections.Description
FROM TblSections INNER JOIN
UMG.Users ON TblSections.SectionID = UMG.Users.SectionID
WHERE (TblSections.Description IS NOT NULL) AND (dbo.Users.LoginName = [@Session(UserName)])
ORDER BY TblSections.Description

I have problem in using Session name in the above BOLD WHERE clause.

View 5 Replies

State Management :: How To Pass Session Variables From .net To Coldfusion

Sep 21, 2010

We are in the process of refactoring from cf to .net, so, I am working on the Login page and converting it from cf to .net. So, when I am autheticated and enter into our website, I need to redirect it to a cfm page (just temporary, since we will be refactoring that also eventually).

So, I am autheticated (using CustomMembership Provider model for sql server) and then when I redirect to the cfm, the app.cfm should validate the .net session variables. Here is where i am stuck:

I have the .net session variables in the aspx side:something like Session["UserId"].ToString() = Value from a login txt box (also authenticated against data in the database)

Session["UserName"].ToString() = Value from the db corresponding to the User Name entered in the text box.

So, now I have all the session variables in the .net side. Now, how do I retreive these .net session in the cf side? Any small peice of code to retrive the asp.net session variable in the application.cfm side would be great.

View 4 Replies

State Management :: Clear The Session When Pass From One Page To Another?

Aug 4, 2010

I have a report parameter page which contains many pop up windows for the parameter selection. For example, for driver , there is a pop up window called driver.aspx which contains a listbox that contains list of driver's name.

Now, for each of these pop up windows, i am passing the values of these windows as a session value.

Now, when a user logs in the system, there are many parameter pages for different reports which commonly share the same pop up windows if the parameters are same for different reports.

The problem now is,a user selects 10 drivers for report 1 and runs it. When he goes to report 2 and runs the report, the report 2 takes only those 10 drivers as the driver parameter value.

It means, the error can arise on the system because he may forgot that he have selected 10 drivers for previous report 1. User will not have time to recheck each previous selected values of different paramaters.

What i want is, when a person moves from one report page to another, i want to clear all the session values and adjust it as default for the new report .

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved