Session variables

If Session("HealthPlanID") = "27" then
Response.Write("  <tr>" & Chr(13))
	Response.Write("    <td align=right><a HREF=" & Chr(34) & "http://localhost:3867/Default1.aspx" & Chr(34) & "><img border=0 src=" & Session("Images") & "rxeob_btn_click.gif></a></td><td>Physicians Look up</td>" & Chr(13))		' Start a PA
	Response.Write("  </tr>" & Chr(13))

end If

Open in new window

  protected void Page_Load(object sender, EventArgs e)    

        Label1.Visible = false;
        if (!IsPostBack)
            SqlDataSource1.SelectCommand = "Select * from tbl_MeriterLogin where 1=2";

        if (lname.Text.Length > 1 && fname.Text.Length > 1 && login.Text.Length > 1)
            Response.Write("Please Enter First and Last Name or NPI");
            GridView1.Visible = false;
            Label1.Visible = true;


            GridView1.Visible = true;
          //string c = Response.ApplyAppPathModifier("http://localhost:1367/PatientDashboard.Web/Default.aspx?session_id=" + sessionId);
        //SeesionID1.Text = sessionStateSection.Cookieless;

        string sessionId = Request.Params["HealthPlanID"];
        TextBox1.Text = sessionId + Request.Params["HealthPlanID"];

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mikensu1Author Commented:
No data is being passed between pages
Kyle AbrahamsSenior .Net DeveloperCommented:
Why are you using  Request.Params["HealthPlanID"];

Shouldn't it be  

käµfm³d 👽Commented:
What is the question here?
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

mikensu1Author Commented:
The quetion is how Do I pass data or why is this not working.  When I try

Open in new window

I get the following error

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0266: Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)

Source Error:

Line 43:
Line 44:         string sessionId = Request.Params["HealthPlanID"];
Line 45:         TextBox1.Text = Session["HealthPlanID"];
Line 46:          
Line 47:     }

Source File: f:\Documents and Settings\mshields\My Documents\desktop\Verify_PA\Verify_PA\Default1.aspx    Line: 45

Show Detailed Compiler Output:

Show Complete Compilation Source:

if I try

Open in new window

I still get no data.
käµfm³d 👽Commented:


Open in new window

is the proper way to deal with:  "Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)." I should point out, however, that if the "thing" being stored in the "HealthPlanID" is actuall a null reference, then you are going to get an exception when the runtime tries to execute ToString. Be sure to add error checking to that bit of code.

Did you take note of ged325's comment ( http:#a37729308 )?
jorge_torizResearch & Development ManagerCommented:
Your ASP and ASPX are in the same project?
mikensu1Author Commented:
Yes same project.
jorge_torizResearch & Development ManagerCommented:
I can't see in your ASP code anything about assigning a value for your HealthPlanID session variable... first of all, if you are not passing values from ASP to ASPX and vice versa, why do you send both codes?

I can't see the relationship... where do you set the HealthPlanID value?
Kyle AbrahamsSenior .Net DeveloperCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.