Click here to Skip to main content
15,884,099 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: gridview row select Pin
Sun Rays22-Nov-07 18:54
Sun Rays22-Nov-07 18:54 
GeneralRe: gridview row select Pin
Sunil Wise22-Nov-07 23:34
professionalSunil Wise22-Nov-07 23:34 
QuestionSearch Pin
Rock Star.22-Nov-07 17:45
Rock Star.22-Nov-07 17:45 
AnswerRe: Search Pin
Christian Graus22-Nov-07 18:06
protectorChristian Graus22-Nov-07 18:06 
AnswerRe: Search Pin
Deepak the Cool22-Nov-07 18:17
Deepak the Cool22-Nov-07 18:17 
QuestionLast 10 disit number or 10 character from from 13 disit nuber or 13 character Pin
Sarfaraj Ahmed22-Nov-07 12:27
Sarfaraj Ahmed22-Nov-07 12:27 
AnswerRe: Last 10 disit number or 10 character from from 13 disit nuber or 13 character Pin
Mustafa Ismail Mustafa22-Nov-07 12:41
Mustafa Ismail Mustafa22-Nov-07 12:41 
QuestionError Message - Try-Catch Block Pin
dataminers22-Nov-07 9:26
dataminers22-Nov-07 9:26 
This code is properly working;

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, userID.ToString(),
DateTime.Now, DateTime.Now.AddMinutes(30), false, userRole.ToString(), FormsAuthentication.FormsCookiePath);

string encTicket = FormsAuthentication.Encrypt(ticket);

HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);

cookie.Expires = DateTime.Now.AddYears(1);

Response.Cookies.Add(cookie);

Response.Redirect(FormsAuthentication.GetRedirectUrl(userID.ToString(), false));


*****But if I use Try-Catch pattern, catch block is running;

try
{
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, userID.ToString(), DateTime.Now, DateTime.Now.AddMinutes(30), false, userRole.ToString(), FormsAuthentication.FormsCookiePath);

string encTicket = FormsAuthentication.Encrypt(ticket);

HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);

cookie.Expires = DateTime.Now.AddYears(1);

Response.Cookies.Add(cookie);

Response.Redirect(FormsAuthentication.GetRedirectUrl(userID.ToString(), false));
}
catch (Exception ex)
{
Response.Redirect("ErrorPage.aspx");
}


Exception Error Message is;
ex = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}


Why I get this message? How can I correct it?

Thanks...
AnswerRe: Error Message - Try-Catch Block Pin
dataminers22-Nov-07 9:57
dataminers22-Nov-07 9:57 
GeneralRe: Error Message - Try-Catch Block Pin
pmarfleet22-Nov-07 11:23
pmarfleet22-Nov-07 11:23 
AnswerRe: Error Message - Try-Catch Block Pin
Sherin Iranimose22-Nov-07 18:12
Sherin Iranimose22-Nov-07 18:12 
QuestionDropdown inside a repeator control using vb Pin
Oga M22-Nov-07 5:53
Oga M22-Nov-07 5:53 
QuestionASP.NET variables and javascript Pin
The Onslaught22-Nov-07 5:04
The Onslaught22-Nov-07 5:04 
AnswerRe: ASP.NET variables and javascript Pin
Braulio Dez22-Nov-07 5:53
Braulio Dez22-Nov-07 5:53 
AnswerRe: ASP.NET variables and javascript Pin
The Onslaught22-Nov-07 6:11
The Onslaught22-Nov-07 6:11 
QuestionRender Control Pin
nzibi22-Nov-07 4:20
nzibi22-Nov-07 4:20 
AnswerRe: Render Control Pin
Braulio Dez22-Nov-07 5:57
Braulio Dez22-Nov-07 5:57 
QuestionLike MaskTextBox Pin
A AntonySP22-Nov-07 2:39
A AntonySP22-Nov-07 2:39 
AnswerRe: Like MaskTextBox Pin
N a v a n e e t h22-Nov-07 3:06
N a v a n e e t h22-Nov-07 3:06 
AnswerRe: Like MaskTextBox Pin
Pete O'Hanlon22-Nov-07 3:21
mvePete O'Hanlon22-Nov-07 3:21 
AnswerRe: Like MaskTextBox Pin
Michael Sync22-Nov-07 4:17
Michael Sync22-Nov-07 4:17 
GeneralRock Bottom Pin
Malcolm Smart22-Nov-07 1:54
Malcolm Smart22-Nov-07 1:54 
GeneralRe: Rock Bottom Pin
N a v a n e e t h22-Nov-07 2:03
N a v a n e e t h22-Nov-07 2:03 
GeneralRe: Rock Bottom Pin
Paddy Boyd22-Nov-07 2:29
Paddy Boyd22-Nov-07 2:29 
JokeRe: Rock Bottom Pin
Vasudevan Deepak Kumar22-Nov-07 19:29
Vasudevan Deepak Kumar22-Nov-07 19:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.