Ahad Siddiqui
Ahad Siddiqui

Reputation: 341

Null exception error while navigating

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 ??

Upvotes: 0

Views: 2575

Answers (2)

Krekkon
Krekkon

Reputation: 1347

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));

Upvotes: 3

Ahad Siddiqui
Ahad Siddiqui

Reputation: 341

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

Upvotes: 3

Related Questions