Jump to content
Sign in to follow this  
snis

roles not work in server

Recommended Posts

snis

Olá meu amigos

Estou com duvidas aqui no asp.net

Na minha maquina local trabalha tudo bem , no entanto quando copio para o servidor a trabalhar estou com problemas.

Implementei roles para gerir os users e assim ter diferente menus a diferentes user's

no entanto quando passo para o servidor aplicação nao trabalha e da sempre o mesmo erro.

basicamente quando efetuo login, se nao houver eu crio uma role

if (!Roles.RoleExists(perfil))
Roles.CreateRole(perfil);

if (!Roles.IsUserInRole(nome, perfil))
Roles.AddUserToRole(nome, perfil);

FormsAuthentication.RedirectFromLoginPage(nome, false);

e depois

quando abre o default tenho diferente roles

Alguém que tenha passado pelo mesmo?

bognr_roles.jpg

Share this post


Link to post
Share on other sites
snis

mas no roleManager?

porque ele consegue fazer validação de user e pass na bd..

so que depois disso nao avança.

mas em localhost corre tudo impecavel

Edited by snis

Share this post


Link to post
Share on other sites
snis

na minha web.config tenho:

<roleManager enabled="true">
  <providers>
    <clear />
    <add connectionStringName="ApplicationServices" applicationName="/"
	  name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
    <add applicationName="/" name="AspNetWindowsTokenRoleProvider"
	  type="System.Web.Security.WindowsTokenRoleProvider" />
  </providers>
   </roleManager>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.