While I'm starting using MVC4 I stack in the issue of changing the page (razor page).
In my `mainPage` finshing the job and now is the time to go to my `loginPage`.
For that reason I use this function in my `mainControllwer`:
Public Function FlagBtn_Click(ByVal myFlag As String) As ActionResult
Attributes.envProp._LanguageFlag = myFlag
Return ViewData("")
End Function
And in `loginController` I have this function:
Function Index() As ActionResult
Dim myView As String = "../Views/Login/loginPage.aspx"
Return View(myView)
End Function
And in my `mainLayout` I have this `ajax` acript:
<script type="text/javascript">
function FlagBtnOnClick(flag) {
var flagName = flag;
$.ajax({
type: 'GET',
url: '@Url.Action("FlagBtn_Click")',
dataType: 'json',
data: { myFlag: flagName },
});
LoginPage();
function LoginPage() {
$.ajax({
type: 'POST',
url: 'login'
dataType: 'json',
});
}
</script>
That is because I want, after the execution of passing the property value to open my new page `loinPage` which is an `*.aspx`page.
Following (with the debbuger) I see that the program comes to the start of the `loginPage` passing from `viewStart` page. That is only if I use an `.vbhtml` page.
And from there goes to the end of the page (footer). Not in the `'.aspx` page
Without passing from the rest of the `html` file.
Instead of that it returns to the `mainLayout` without any error threw me on the `Chrome` debugger. For html page. And whith the following error for the `aspx` page
For `.aspx` thew me the error of.
VM27 jquery.min.js:6 XHR finished loading: GET "http://localhost:49254/main/FlagBtn_Click?myFlag=gr".
send @ VM27 jquery.min.js:6
ajax @ VM27 jquery.min.js:6
FlagBtnOnClick @ (index):54
onclick @ (index):109
VM27 jquery.min.js:6
XHR failed loading: POST "http://localhost:49254/login".
And from there to the `mainPage`.
It obvious that I'm doing something wrong... But what???
Additionally I can say that I'm using the same `LayoutPage` for both of the pages.
What I have tried:
With the above post I give everything I have made until now.