0

In my windows store application , i am passing some parameters between two pages like this:

Window.Current.Content = new page2(a1,a2,a3);

and accessing that parameters in page2 like this :

 public page2(string a1, string a2, string a3)
{this.InitializeComponent();}   

everything works fine, but when i am trying to navigate from page2 to another page , a null exception is occurring. what is the problem ??

Ahad Siddiqui
  • 331
  • 1
  • 2
  • 13
  • This is not nearly enough code to find where you might be getting a null ref. Also, if you look at the stack trace of the exception, it should tell you exactly where the null exception is being thrown... – Caleb Mar 15 '14 at 07:47
  • null exception is thrown at this line 'this.Frame.Navigate(typeof(page3));' (navigating on button click) – Ahad Siddiqui Mar 15 '14 at 07:49

2 Answers2

3

Please check the following thread. Possible you can follow this solution for resolve your issue.

Or you can try that too:

var frame = (Frame)Window.Current.Content;
frame.Navigate(typeof(Page3));
Phantom
  • 378
  • 3
  • 19
Krekkon
  • 1,349
  • 14
  • 35
2

I have solved the issue by using this kind of navigation Window.Current.Content = new page2(); instead of this this.Frame.Navigate(typeof(page));

Ahad Siddiqui
  • 331
  • 1
  • 2
  • 13