mindarch
Posts: 30
|
Posted: 06/06/2005, 10:47 AM |
|
I am working on an application with code charge. Essentially it is many screens of info, but all about clients. So, what I would like to do is the following.
When a user logs in, they are taken to the client list. They choose a client. A session variable gets set that has the value of the clientsid.
Now, whenever they go to any other form screen, the sql for getting the information will pick up that session("clientsid") and use it as the where in the sql statement. SO the information given automatically on any other screen is only the info about that client.
I'm not sure how to do this. I got the session variable set and is storing the clientsid. Not sure where the sql commands are that I can add to the where clause to say
... where clientsid = " & SESSION("clientsid")
Or is there a different or better way of doing this? Something click and gui like that I've missed?
_________________
Mind Architecture
stephen@mindarch.com |
|
|
mindarch
Posts: 30
|
Posted: 06/06/2005, 12:00 PM |
|
Hm, ok. Page 432 of the component reference. I added:
'Grid journal Event BeforeBuildSelect. Action Custom Code @32-73254650
' -------------------------
DirectCast(Select_,TableCommand).Where = "clientsid = " & SESSION("clientsid")
DirectCast(Select_,TableCommand).Operation = "AND"
' -------------------------
'End Grid journal Event BeforeBuildSelect. Action Custom Code
I do have the SESSION("clientsid") set because on the clients_list page I can Response.Write(SESSION("clientsid")) to see the id that is set and it does change when selecting a different client.
BUT when I generate code with the above added action custom code I get:
Error: C:\DOCUME~1\mindarch\LOCALS~1\Temp\~ATLAS~1\components\journal_listDataProvider.vb(273) : error BC30451: Name 'SESSION' is not declared.
so I tried adding DIM SESSION("clientsid") in global and still getting the same.
I'm not that up on ASP anymore and this has me stumped. Any suggestions?
_________________
Mind Architecture
stephen@mindarch.com |
|
|
peterr
Posts: 5971
|
Posted: 06/06/2005, 12:34 PM |
|
It seems that you are using ASP syntax with VB.NET and they are not compatible. I've looked through the common files and in DataUtility.vb I found such syntax being used:
HttpContext.Current.Session("UserID")
I don't know VB.NET, but suspect that's the correct syntax.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
mindarch
Posts: 30
|
Posted: 06/06/2005, 5:02 PM |
|
I have these files: clients_list and clients_maint. I want to have a session set when you click on someone in the client_list and are taken to the client_maint. So I put this in client_main Server BeforeShow:
Session("clientsid") = Request.Querystring("clientsid")
On clients_list I put the following in Server BeforeShow:
Response.write(Session("clientsid"))
All is well and good. When I click a client and then go back to client_list I get the id number of that client displayed.
Now, I also have journal list. I want this to list just the journal entries for the client that has been selected and we just set a SESSION variable for.
I looked in the component reference and copies the code on 432 to dynamically modify a where clause with vb.net. So in BeforeBuildSelect I have:
DirectCast(Select_,TableCommand).Where = "journal = " & SESSION("clientsid")
DirectCast(Select_,TableCommand).Operation = "AND"
And then when I generate and publish I get the following error:
C:\DOCUME~1\mindarch\LOCALS~1\Temp\~ATLAS~1\components\journal_listDataProvider.vb(273) : error BC30451: Name 'SESSION' is not declared.
DirectCast(Select_,TableCommand).Where = "journal = " & SESSION("clientsid")
~~~~~~~
I don't understand why it works on one page and not another and why it is asking to be declared like that on the journal page. I tried adding a dim right before it and got:
C:\DOCUME~1\mindarch\LOCALS~1\Temp\~ATLAS~1\components\journal_listDataProvider.vb(273) : error BC30002: Type 'Session' is not defined.
Dim SESSION("clientsid") as Session
~~~~~~~
C:\DOCUME~1\mindarch\LOCALS~1\Temp\~ATLAS~1>REM _End MakeAll
I'm missing something and not sure what.
_________________
Mind Architecture
stephen@mindarch.com |
|
|
peterr
Posts: 5971
|
Posted: 06/06/2005, 5:13 PM |
|
Not sure if you saw my response above. Searching for your error message on Google shows the same thing: http://groups-beta.google.com/group/microsoft.public.do...48df149adf99ac1 http://www.dotnet247.com/247reference/msgs/9/47447.aspx
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
Tuong Do
|
Posted: 06/06/2005, 7:15 PM |
|
Hi mindarch,
Since you are in the DataProvider page you must use the full path to the
assembly
Use this
DirectCast(Select_,TableCommand).Where = "journal = " &
HTTPContext.Current.SESSION("clientsid")
"mindarch" <mindarch@forum.codecharge> wrote in message
news:842a4e42b3f6fb@news.codecharge.com...
>I have these files: clients_list and clients_maint. I want to have a
>session
> set when you click on someone in the client_list and are taken to the
> client_maint. So I put this in client_main Server BeforeShow:
> Session("clientsid") = Request.Querystring("clientsid")
>
> On clients_list I put the following in Server BeforeShow:
> Response.write(Session("clientsid"))
>
> All is well and good. When I click a client and then go back to
> client_list I
> get the id number of that client displayed.
>
> Now, I also have journal list. I want this to list just the journal
> entries
> for the client that has been selected and we just set a SESSION variable
> for.
> I looked in the component reference and copies the code on 432 to
> dynamically
> modify a where clause with vb.net. So in BeforeBuildSelect I have:
>
> DirectCast(Select_,TableCommand).Where = "journal = " &
> SESSION("clientsid")
> DirectCast(Select_,TableCommand).Operation = "AND"
>
> And then when I generate and publish I get the following error:
>
>
> C:\DOCUME~1\mindarch\LOCALS~1\Temp\~ATLAS~1\components\journal_listDataProvider.vb(273)
> : error BC30451: Name 'SESSION' is not declared.
>
>
>
> DirectCast(Select_,TableCommand).Where = "journal = " &
> SESSION("clientsid")
>
> ~~~~~~~
>
> I don't understand why it works on one page and not another and why it is
> asking to be declared like that on the journal page. I tried adding a dim
> right before it and got:
>
> C:\DOCUME~1\mindarch\LOCALS~1\Temp\~ATLAS~1\components\journal_listDataProvider.vb(273)
> : error BC30002: Type 'Session' is not defined.
>
>
>
> Dim SESSION("clientsid") as Session
>
> ~~~~~~~
>
>
>
> C:\DOCUME~1\mindarch\LOCALS~1\Temp\~ATLAS~1>REM _End MakeAll
>
>
>
>
> I'm missing something and not sure what.
>
> _________________
> Mind Architecture
>stephen@mindarch.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
Stan
|
Posted: 06/07/2005, 12:42 AM |
|
Hi mindarch,
The full path in your case will be System.Web.HttpContext.Current.Session
Stan
|
|
|
|