I was guided by Nuux who was kind enough to help me through the intricate process of localizing my website, and then giving the client the option to manually select their own language by clicking a flag and it lasts for their entire time/session they're on the website. My website is Visual Studio 2010 / vb / net 4.0.
In doing so, I created a class, BasePage.vb. ALL of my pages are set to inherit: BasePage in their code behind. Here's a line of interest from BasePage.vb:
'retrieve culture information from session Dim culture__1 As String = Convert.ToString(Session([Global].SESSION_KEY_CULTURE))
Everything functions great, and Nuux was a perfect help. I have 1 remaining issue. When I go to my homepage (or any page), there's a strange query string in there. I think it's that line in BasePage.vb, more than something on a page's code behind, because it happens even if I open a browser, bypass the homepage by going directly to mydomain/about.aspx. For instance, just go to the about page and this shows up: mydomain.com/(S(tp5bafoygn0ahwdp1mh0x4v5))/about.aspx
But the languages work great and last the entire session! What is the (S(tp5bafoygn0ahwdp1mh0x4v5)) ? Should I get rid of it, and if so, how would I go about doing this?
Is it possible to create a variable that is global for each session in ASP.NET? Usually I do this with Session:
Session("my_variable") = 10 But this necessitates casting it every time I want to use it like so: Dim my_variable as String = CInt(Session("my_variable"))
How to create remember me checkbox to remember session until userlogout ..? If user directly close their browser without logout then next time they open browser its session will be maintained as it is till they logout from session ..
Anyone have an example of creating a signed URL with an expiration using ASP .Net? I'm exploring using LitS3 or ThreeSharp in my project, and have not seen any specific methods to do this in either of those projects.
I have an application that was deployed almost a year ago using clickonce. My Test certificate is about to expire. Seemed to have read somewhere that the problem was fixed in VS 2008. Can someone confirm and tell me if there is something I have to do to keep my users up and running? Also, if I make changes to the application and redeploy after the expire date, is there anything I need to do? I don't know anything about certificates just that I had to create one to use ClickOnce.
I am storing a session variable that a user types into a textbox. With their valid input, their session gets created and they get a little more functionality than the regular end users of the site.I was wondering if it is possible to find a way to add someone's session variable to the end of a URL. This way we can email a link to one of our clients, they click it, and their session has automatically begun. They already have the textbox to enter their code into, but I was told that it would be much easier for the users to just click a link that will start their session.
On startup of my software which i developed in vb.net, it connects to mssql server. I want to have session id or session number of the connection with mssql. I'm sure it is unique number and i want to use this session in my software for different purposes. My question is
1. is there anything like session id or session unique number when you connection mssql server
I have a page, a session starts on page load (using global.asax) the user may not move from (or interact with) that page for a long while and I dont want to increase the session timeout. When the session times out after say.. 20 minutes, I want to start a new one, without moving from the page. I also don't want constant keep-alives i want to do it via another method (timer, button press...)
Partial Class Preferences_MyPreferences Inherits System.Web.UI.Page Dim userID As String = Session("UserID")
This is just a page in asp.net. I want to be able to grab the Session("UserID") but every time I try, I get this error:
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \ section in the application configuration.
If I put that Dim userID inside say the Page_Load Event, then it works fine. Why does it have to be inside an event? I want to dim it once, and use it throughout the page.
I have an 2-d arraylist with 2 fixed columns and dynamic rows. The arraylist will be assigned to the session variable at the end of the code below. My question is how can loop thorugh the arraylist from the session to get its value?
If .SQLDS.Tables(.sSQLDSTbl).Rows.Count > 0 Then Dim NoOfAdjType(1, .SQLDS.Tables(.sSQLDSTbl).Rows.Count - 1) For iRow As Integer = 0 To .SQLDS.Tables(.sSQLDSTbl).Rows.Count - 1
We have implemented exam on a single page and store the option in view state as users selects the same. On select of next question page is loaded again. Sometime "If Session("User") = """ turns out true and user logs out.I did setup session on first time page load as
Session.Timeout = 340
Also in web config file session timeout is 2 hours.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Session("User") = "" Then Response.Redirect("Default.aspx")
Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If IsPostBack = True Then
[code]....
Three buttons-ABC,CBA and Show. if you click on ABC and then Click on Show button The textbox shows "ABC" but when I Clicking on CBA button And then Click on Show button The textbox shows again "ABC". IsPostback property will true on each time the page is posted to the server. So the session reset the value.
I have an ASP.NET application that I am developing. I'm using session variables within the app.In Firefox & Chrome, they all work.But in IE (ver 9), there's one variable that's not working. I'm not sure if it's a storage or a retrieval (or both) at this point. The variable in question that I'm storing is a List(T) type. It's the only one of it's kind that I'm using. Can't help but think there's a correlation there.One other old post mentioned the possibility that cache is causing the problem, but I didn't understand the answer very well.
Dim Rec_IDs As New List(Of String) Rec_IDs = Session("Rec_IDs") and Dim Rec_IDs As New List(Of String)
Protected Sub login_Click(ByVal sender As Object, ByVal e As EventArgs) Handles login.Click Dim querystrings As String = "Select Email, Password ,Roles, Nama_Depan, Nama_Belakang from Employee where Email = @email;"
how to POST to a php file form a vb.net app: http:[url].... So now I've logged in the user user by posting their username and password to the php file, the php file then does security/checks they exist/etc and if both username and password are correct is stores the user ID in a session variable.Now if the vb.net app tries to download data off a page which needs the user to logged in, it checks this by doing:
if (!isset($_SESSION['uid'])) { header("Location: index.php"); }
However after having logged correctly in the app the session variable is not set.How does session work with a vb.net app like this?When the user logs in successfully should I download the user id and keep it in the vb.net app and then post it to each page that requires authentication?
I am using visual basic ADO reference to connect to Teradata database. In the code I hold the metadata in the volatile table, However after fixed number of SQL execution statements the session changes thus erasing all the data of the previous session stored as volatile tables. Is there a way to keep the session same during the execution of the code.
I have written a page with an iFrame that basically cycles through a series of internal pages on our server displaying daily activity for our company. The problem I think is that it sporadically loses its session and redirects back to the login screen to keep losing its session which is the default behavior for anyone on our site trying to access a webpage without being logged in.
I have set the session timeout to 4hrs, the iframe cycles through 6 pages anywhere from 10 seconds to 5 minutes on each, and I have even set the META refresh on the page to refresh every 3 hours. I don't understand what else could possibly stop this page from staying active.
I have an aspx page with a button, the user clicks the button a session variable gets set, I then read the session variable later. here is an exaple of my button:
I programmed my website using visual basic code (via microsoft expression web) and need to post information to a remote location using a php page. How do I take variables from my visual basic code and transfer them to my php code? I was thinking sessions would work, but I haven't figured it out yet.
I am building a User Management section to a website CMS.The user has a list of users and then clicks the edit button, the system then stored the UserId in a session and goes to the editUser.aspx page which will show the users details.To get the users details I need to convert the UserId session to a Guid so i can get user details.
I keep getting error message:
System.InvalidCastException: Specified cast is not valid.
Dim selectedUserId As Guid = CType(Session("strUserId"), Guid) Dim mu As MembershipUser = Membership.GetUser(selectedUserId)
Ok, so I have this code written in C++ that call the function SetThreadDesktop. I call this function from a dll when running as System user on Windows XP.
When called from a C# console application, the function succeeds, but when called from a VB.NET console application, it doesn't. With GetLastError, I saw that the error message was this:
SetThreadDesktop failed with error 170: The requested resource is in use (translated from french)
How does it come that it works for a C# console app and not for a VB.NET one? Btw, it doesn't work for a winform app neither. Is it a compiler option that I have to change?
I have a asp.net web form which will submit information to come as emails. Whenever user fill the form and click on submit button,the information user entered will be sent as email.This web form has 4 page. but the web form will not use all 4 page on all requests.
if the user select a particular value in first page, the form will bypass the 3rd page and go the last 4th page(like...page1,2,4). IF it is any other values selected in the first page. form will navigate as page1,2,3,4.
So now my problem is when multiple users access the same website, the value in the first page get combines from different users and the form will act abnormally.Sometime it will bypass sometimes it will not bypass the page3
Show below is the variable decalrations:
Public strRoleType As String = String.Empty Protected Shared isAreaSelected As Integer = 0 Protected Shared isStoreSelected As Integer = 0 Protected Shared isHeadOfficeSelected As Integer = 0 Protected Shared isRegionSelected As Integer = 0
I guess the problem is with strRoleType variable whether it is getting values from different users.
i noticed in vb.net that when declaring new connection objects it creates a new session. and sometimes it reuses an existing one.is this an expected behavior?
in my application i created a global temporary table. in oracle, this acts like a table but session based. the behavior mentioned above is causing some issues with my temporary table as new sessions are being created and thus, i'm not able to get the desired data from the table.i thought of using a global connection but not sure if this is the best way.
In my project I am using a session table. I am binding this session table to the gridview,in gridview row updating event.I keep the records of session table to a datatable and I use the code below code for updating:
My problem is when using PageIndexChanging, I can edit in the 1st page of GridView without any problem, but in second page it is editing the one corresponding to e.RowIndex in the first page, so no change occurs other than the first page in the gridview.