Open in new window

  • Thread starter Thread starter David C
  • Start date Start date
Of couse the agents.aspx is inclosed in quotes (typo) in the redirect line.

I also tried commenting out the session variable statements and tried
"agents.aspx?acct=1106" and used the Request.QueryString("acct"). This
didn't give an exception (and took me to the page), but didn't set the
accountNumber.Text either.

Also, with the Redirect, the back button becomes disabled. Is this expected
?

Shelly
 
Of couse the agents.aspx is inclosed in quotes (typo) in the redirect
line.

And it's Response.Redirect, not Resume.Redirect - missed that in my previous
reply...
I also tried commenting out the session variable statements and tried
"agents.aspx?acct=1106" and used the Request.QueryString("acct"). This
didn't give an exception (and took me to the page), but didn't set the
accountNumber.Text either.
Request.QueryString("acct").ToString()

Also, with the Redirect, the back button becomes disabled. Is this
expected ?

No..
 
Mark Rae said:
And it's Response.Redirect, not Resume.Redirect - missed that in my
previous reply...


No..
(A)
I fixed it to Response.QueryString("acct").ToString()
and Response.Redirect("agents.aspx?acct=1106", false)

It (1) goes to that page, (2) the back button is there, and (3) nothing
shows in accountNumber.Text

(B)
Also, using the other method, why couldn't I set a session variable. It
complained about that line. When I put in that line and started typing
session, it filled out the word "Session". But after I put in the rest
andgot to the acct.Text part, it didn't present me with acct (or anything,
for that matter) when I started typing it. If I start a line with ac it
presents me with the control acct, just not after the 'Session["acct"] ='
start of the line.

So, I still have two problems.
 
Also, using the other method, why couldn't I set a session variable. It
complained about that line. When I put in that line and started typing
session, it filled out the word "Session". But after I put in the rest
andgot to the acct.Text part, it didn't present me with acct (or anything,
for that matter) when I started typing it. If I start a line with ac it
presents me with the control acct, just not after the 'Session["acct"] ='
start of the line.


Apologies, I think that's my fault...

I never go anywhere near VB.NET, so I sometimes forget the syntatical
differences...

If, instead of Session["acct"] you try Session("acct") does it work...?
 
Mark Rae said:
Also, using the other method, why couldn't I set a session variable. It
complained about that line. When I put in that line and started typing
session, it filled out the word "Session". But after I put in the rest
andgot to the acct.Text part, it didn't present me with acct (or
anything, for that matter) when I started typing it. If I start a line
with ac it presents me with the control acct, just not after the
'Session["acct"] =' start of the line.


Apologies, I think that's my fault...

Man, he is human after all :-) I'll match your one against my [at least]
100.
I never go anywhere near VB.NET, so I sometimes forget the syntatical
differences...

I would have used C#, except that most of the jobs here seem to say VB.Net.
So, I went that way. (I tell you it is a bitch to go back and forth between
a sentence delimited language (C#, PHP, C, Java, etc.) and a card image [aka
lines] one (VB, Fortran, Basic). I always seem to leave of the ";" when I
flip back :-) )
If, instead of Session["acct"] you try Session("acct") does it work...?

Well, it didn't produce any errors, but it didn't get the value either.

In company.aspx.vb I have in the agents_Click subroutine:
Session("acct") = acct.Text
Response.Redirect("agents.aspx", False)

and in the agents.aspx.vb Page_load I have:
accountNumber.Text = Session("acct").ToString()
Session.Remove("acct")

and, yes, there is a TextBox control "acct" in company.aspx and there is a
TextBox control accountNumber in agents.aspx.

So, now there are two things that give the next page, but neither way gives
me either session variable or the passed variable.

Shelly
 
....

Mark, I figured it out. I went into the debugger and found that the
Page_Load routine in the target page was not firing. I figured out why. It
is because I did not have "Handles Me.Load" at the end of the subroutine
declaration.

In the process of the investigation, I also came across where I could read
the value of the previous page's control from within the target page. I
bookmarked that page for later study.

Thanks for all the help.

Shelly
 
Mark, I figured it out. I went into the debugger and found that the
Page_Load routine in the target page was not firing. I figured out why.
It is because I did not have "Handles Me.Load" at the end of the
subroutine declaration.

Ah... yet another reason to ditch VB.NET immediately and move to C#... ;-)
 
Back
Top