Hi Dw

I'm working with ASPX.NET under VB.NET, I've created some pages one is registering the user domain that the user want to register like "www.mydomain.com" and once the user clicked the button then his domain is registered to the server and then he/she will then be transferred to another page where he/she will then register an account so that he/she will then be able to manage and upload files to his domain, now on the domain register page there is a textbox where the user will enter the his domain that he want to register and there is a dropbox which the user will use to choose the extension (location) to complete his/her domain e.g(.com) then I combine the textbox and the chosen extension which then complete or make up the full domain which is also the user username now on the server the system creates the folder named the user domain which inside will be the users files or web files and inside the domain file there is a file I created called user which contains all the user details and picture so that when the user logs in the details will be retrieved from here now the problem I'm having is to pass this domain name to the page that the user will be transferred to after registering the domain so that he can create an account so I want to retrieve the domain name from the domain registry page, normal in windows form application in VB.NET I would do it like this, let say the domain registry page is form1 and the user registry account page is form to, I would add a label in form1 and on form_Load() I would hide this label so that it won't be visible and assign it like this Label1.Text = "www." & TextBox1.Text & DropBox1.SelectedItem.ToString and to pass this the domain to Form2 I would do it like this 'Dim Username As String = Form1.Label1.Text' so I want to do something like this so that I can be able so write something like Dim Name As String = txtName.Text
My.Computer.FileSystem.WriteAllText("C:\wamp\www"& Username.ToString & "\User\Name.txt",Name,True) so now if you can notice I've used the name that retrieves the Username from the domain in Form1 and then use it as Username which the client file in the system is also called or named as the Username or Domain so in order for me to put the data inside the current users files I have to use his/her domain because the files will be severed user this domain inside the folder named as domain name. So my problem is passing like this the name from other page to another page in ASP.NET in VB.NET

Recommended Answers

All 5 Replies

Hi M,

There are a variety of ways you can pass data between pages. Have you considered using cookies, session variables, query strings, or form requests?

Could you tell us which methods you have tried. Which methods do not match your requirement and why?

You may find Microsoft's ASP.NET Session State Overview page helpful.

So my problem is passing like this the name from other page to another page in ASP.NET in VB.NET

There are several ways to pass data from page to page.

1) pass the data via a Query String
2) store the data in a session variable
3) store the data in a cookie
4) store the data in a data source, such as a database record

You store the value using one of the options above, then retrieve the value on the target page.

There is no right or wrong here, it all depends on exactly what your requirements are. One of the easiest methods is to pass the value via query string, but that allows the user to manipulate the URL. I would suggest you consider the session variable option.

Thank you so much guys, now I just have one more question, on how can I save or recognize the user by a WebBrowser just like how DaniWeb remember my WebBrowser once I've typed www.daniweb.com on my phone it then go to daniweb and because I've never log out using this phone it still recognize me and load by account, so how can I do the same on my clients if they haven't logged out still process user their names?

Thank you again, will only mark this thread answered when I get your response.

This is done by storing information in a cookie. What you do in you vb.net code is request the cookie and examine the contents. If the cookie exists and the information you are looking for is there (login info, timestamp, etc..), then you consider the user being logged in.

I'd recommend that you take a look at this MSDN article: ASP.NET Cookies Overview

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.