Click here to Skip to main content
15,881,832 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am trying to navigate to an website (localy hosted on IIS ) in and webview control. after loading of homepage (login.aspx) and successful login it redirects to onother page (userspage.aspx), but as soon as I click on login button it throws an exception "navCancelInit is undefined".
How can I solve this problem ?
please help asap.

additional information copied from comment below
C#
string username = "xxxxxx";
string password = "yyyyyy";
var handler = new HttpClientHandler();
handler.Credentials = new NetworkCredential(username, password);
            
HttpClient httpClient = new HttpClient(handler);

//HttpClient httpClient = new HttpClient();
            
HttpResponseMessage response = await httpClient.GetAsync("http://localhost:9090/");

System.Diagnostics.Debug.WriteLine("response: " + response);
string responseAsString = await response.Content.ReadAsStringAsync();
System.Diagnostics.Debug.WriteLine("response string:" + responseAsString);

webView.NavigateToString(responseAsString);

this is the code which runs and displays login.aspx in webview.... after login it redirects to userspage.aspx. but as soon as i click on login button in login.aspx after providing correct username and password, it throws that exception "navCancelInit" is undefined
Posted
Updated 9-Dec-13 21:42pm
v4
Comments
Nelek 10-Dec-13 3:23am    
What have you tried?[^]
Please use the "improve question" and add a code snippet involved in the problem. It will be easier to help you
Member 9745163 10-Dec-13 3:37am    
string username = "xxxxxx";
string password = "yyyyyy";
var handler = new HttpClientHandler();
handler.Credentials = new NetworkCredential(username, password);

HttpClient httpClient = new HttpClient(handler);

//HttpClient httpClient = new HttpClient();



HttpResponseMessage response = await httpClient.GetAsync("http://localhost:9090/");


System.Diagnostics.Debug.WriteLine("response: " + response);
string responseAsString = await response.Content.ReadAsStringAsync();
System.Diagnostics.Debug.WriteLine("response string:" + responseAsString);


webView.NavigateToString(responseAsString);



this is the code which runs and displays login.aspx in webview.... after login it redirects to userspage.aspx. but as soon as i click on login button in login.aspx after providing correct username and password, it throws that exception "navCancelInit" is undefined

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900