4 Replies - 604 Views - Last Post: 21 September 2011 - 03:06 PM Rate Topic: -----

#1 Boyan  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 254
  • Joined: 09-September 07

Showing data in another page

Posted 21 September 2011 - 06:04 AM

Hi!

I have this code here:

            ProfileCommon userProfile = Profile.GetProfile(Membership.GetUser().ToString());
            FirstNameTextBox.Text = userProfile.FirstName;
            LastNameTextBox.Text = Server.HtmlDecode(Profile.LastName);
            EmailTextBox.Text = Membership.GetUser().Email;
            tbIndex.Text = userProfile.Indeks.ToString();
            tbUserAgent.Text = Request.UserAgent.ToString();
            Calendar.SelectedDate = userProfile.UserDate.Date;
            Calendar.VisibleDate = userProfile.UserDate.Date;
            EmailTextBox.Text = Membership.GetUser().Email;
            DataTextBox.Text = userProfile.UserDate.Date.ToString();
            IPTextBox.Text = userProfile.UserIP.ToString();



It needs to be shown in another page, something like “You are registered at ……… time, with ……… browser.” Do I need to link the two pages before to work? Any suggestions how to get the date from this code to work in the other one?

Thank you. I know it's very simple, but I fail at something and help would be appreciated. Thanks again.

Is This A Good Question/Topic? 0
  • +

Replies To: Showing data in another page

#2 mb2000inc  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 333
  • Joined: 10-November 09

Re: Showing data in another page

Posted 21 September 2011 - 07:54 AM

When user fills this out - is the information stored anywhere?
When the user clicks "next" or "ok" and you go to another page - is that when you want to display the information?

If all you want to do is display it on the page and never keep the information, you can try a session variable - then when the new page opens, it reads the info stored in the session.

Or If you're storing it in a database, then you can just pull it from there.

Maybe a little more info on what you want to do with it?
Was This Post Helpful? 1
  • +
  • -

#3 Boyan  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 254
  • Joined: 09-September 07

Re: Showing data in another page

Posted 21 September 2011 - 08:57 AM

Yes, I'm using a database, but the code should be something like this:

"You are using" + tbUserAgent.Text


I'm not sure how to do that. Since it's a kinda part of a project, I'm not able to test it and see if it works... :S

Thank you.
Was This Post Helpful? 0
  • +
  • -

#4 mb2000inc  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 333
  • Joined: 10-November 09

Re: Showing data in another page

Posted 21 September 2011 - 10:01 AM

I know this has nothing to do with your actual topic, but, if you scroll down in the post, there's a code section that tells you how to discover the "user agent".

http://www.dreaminco...or-html5-video/

I trimmed it down for you.

On Page Load, Request the browser...

protected void Page_Load(object sender, EventArgs e)
{
      //automatic browser detection
      System.Web.HttpBrowserCapabilities browser = Request.Browser;
      string bName = browser.Browser;//get browser name
}



Then once you have the browser, populate the "tbUserAgent.Text". You may need .ToString() at the end

Hope that helps a little bit.

This post has been edited by mb2000inc: 21 September 2011 - 10:04 AM

Was This Post Helpful? 0
  • +
  • -

#5 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 441
  • View blog
  • Posts: 1,488
  • Joined: 28-April 09

Re: Showing data in another page

Posted 21 September 2011 - 03:06 PM

if you are trying to get browser information you could also look at trying to use javascript's navigator object


Javascript Browser Detection
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1