i'm trying create custom login on custom database. database has username & password (name, address, ect). problem authorization. when put in web.config <authorization></authorization>
, run program won't load masterpage design. what's alternative authorization? , found code global.asax (for session):
void application_onpostrequesthandlerexecute() { checklogin(); } void checklogin() { string url = request.rawurl; int count = url.length - 10; string testurl = url.substring(count); string sessiondata = session["authenticate"].tostring(); if (sessiondata == "" && testurl != "home.aspx") { response.redirect("~/home.aspx"); } }
can explain little? mean testurl
, why couter there (url.lenght-10)?
do mean authentication or authorization? these different concepts.
the function provided, checks in strange way whether page requested homepage or session variable "authenticate" empty.
are using asp.net mvc? or plain asp.net?
i recommend search on google on topic "custom formsauthentication asp.net"
Comments
Post a Comment