Home > Net >  For help! MVC login window
For help! MVC login window

Time:09-21

Write a web page in asp.net MVC, in certain operations is to ensure that the login status, consider using authentication filter, verify by customs, not by let him go to login, then the problem comes, log in using the bootstrap modal dialog is done, but I don't know how to open this mode in the filter box, when studying the bootstrap to see there are two kinds of modal dialog open way, is a link or button, it definitely won't work, then can only use js code, but how to output the js into HTML from the server? With the response. It's useless to write, I also don't know the other way, consider directly at the front desk to write js judgment login status and then decided to open the login window or continue to perform the requested, but if so this filter is not just doesn't do anything, feeling should not implement, online search along while also didn't find any good solutions, solving, less code to write, want to have a train of thought

CodePudding user response:

Do you not use a filter, at the time of intercepting verify login, if there is no login is returned to the client, and then you popup modal dialog, why do you want to return from the background modal dialog?

CodePudding user response:

Separate returns to a login page,
Is not the kind of the modal dialog

CodePudding user response:

Modal words can also..

Global a js write inside a method..

Similar
 
The function showLogin ()
{
XXX. Showdia...
}


Then judge if there is no landing in interceptor output a js not redirected...

CodePudding user response:

How the output of js, the response. The write? Use this output is only a js code, the background is there any way you can call page written js

CodePudding user response:

refer to the second floor is nu month god reply:
separate returns to a login page,
Is not the kind of the modal dialog

Do so just bypass the problem but did not solve the problem

CodePudding user response:

reference 1/f, hands on the keyboard to knock very light response:
do you not use a filter, at the time of intercepting verify login, if there is no login is returned to the client, and then you popup modal dialog, why do you want to return from the background modal dialog?

Not return from the background modal box, but prints a js background, to open the modal dialog with js, the question now is I don't know how to write js the current page

CodePudding user response:

In the request the back-end home/method, the index page jump to the login page

CodePudding user response:

If it is the MVC project, the method of using the upstairs
"In the request the back-end home/method, the index page jump to the login page"
If the separation of front and back side pattern
No backend in js,
The back-end return status, success or failure, controlled by the front-end js, opens the page of the modal window or jump,
  • Related