윈도우 10 UWP 웹보기윈도우 10 UWP 웹보기 지역 URL 문제
내가 가지고 윈도우 10 UWP에서 자산 (자산/www /에서 xxx.html) 아래에 www가 폴더에있는 두 개의 HTML 파일, VS에서 두 파일 2015가 출력 디렉토리에 복사되도록 설정됩니다.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Simple Script</title>
</head>
<body>
<form action="submit.html" method="post">
Data:<input type="text" name="somedata" > <br> <br>
<input type="submit" value="Submit" >
</form>
</body>
</html>
and submit.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dummy Submission</title>
</head>
<body>
<h2> Your data has been submitted - Thank You. </h2>
</body>
</html>
웹보기 개체가
<WebView x:Name="WebBrowser" HorizontalAlignment="Left" VerticalAlignment="Top" Height="532" Width="1014" NavigationStarting="WebBrowser_NavigationStarting"/>
아래와 같이 XMAL에 embbeded하고 인덱스 페이지가 제대로
/// Helper to perform the navigation in webview
/// </summary>
/// <param name="url"></param>
private void NavigateWebview(string url)
{
try
{
Uri targetUri = new Uri(url);
WebBrowser.Navigate(targetUri);
}
catch (FormatException myE)
{
// Bad address
WebBrowser.NavigateToString(String.Format("<h1>Address is invalid, try again. Details --> {0}.</h1>", myE.Message));
}
}
NavigateWebview(@"ms-appx-web:///Assets/www/index.html");
페이지로드 및 표시에 의해로드되어 있지만 표시되지 않습니다 연결된 'submit.html'페이지, 그냥 비어 있습니다.
내비게이션 이벤트를 트랩하면 발생하지만 아래에 표시된 것처럼 GUID가 접두사로 표시됩니다.
절대 경로 등을 변경하고 문서를 자세하게 읽었지만 이것이 작동하지 않는 이유는 알 수 없습니다.
아이디어하시기 바랍니다들 ...
제출이 index.html과 동일한 폴더에 있으면 index.html을 ms-appx-web : //Submit.html로 변경하면 제대로 작동합니다. – AVK
파일, URL 등의 모든 조합을 시도했습니다. 탐색 이벤트에는 모두 표시되지만 페이지는 표시되지 않습니다. 두 파일은 테스트 한 모든 브라우저에서 완벽하게 작동합니다. 웹보기에서 링크 된 페이지를 표시 할 수 없습니다. DOM의 다른 모든 기능은 정상적으로 작동합니다. –