|
I have created a link button as signout.
On click of liink button i have done following coding
FormsAuthentication.SignOut();
Response.Redirect("Login1.aspx");
This works only if i try to access any page by typing in url.
but if i click on back button it permits me to visit the page..
Might be my cookies are interfering with this as i have used persistant cookie on the login page..
Please suggest a soln to this
scotchy
|
|
|
|
|
Hi scotchy
The page is probably being cached.
To turn off caching for the page, use this code:
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
Regards
Rajeesh MP
|
|
|
|
|
Thx Rajeesh for the soln..
I dont know whether this is correct or not..
I have inserted the code in MasterPage and working for me..
just want to know whether things can be made at the Global.asax
Regards
scotchy
modified on Tuesday, January 13, 2009 1:18 AM
|
|
|
|
|
hi scotchy
ha ha ha..GREAT
|
|
|
|
|
I have a project to do its a 3 tier project which uses .net and java and its a registration system for students!!!!!!!!! can someone help me please i am even willing to pay i need this project finished for school ill give more information email me at cmpfwssp10@gmail.com please
|
|
|
|
|
Leona T wrote: i am even willing to pay i need this project
goto to rentacoder.com .
|
|
|
|
|
hi all,
i have requirement to find previous date
my input will be month and year,
for eg: 01/2009, it should return the month and year exactly six months back
i.e 07/2008,
how to solve this,
winnie
|
|
|
|
|
Just create datetime types in .net with your current dates
and then use AddMonth with -6 parameter!
try it,just two line of code
Human knowledge belongs to the world
|
|
|
|
|
|
Should have made him work for it, its too simple of a question
only two letters away from being an asset
|
|
|
|
|
Learning to RTFM[^] can AddMonths to your career but AddMonths could be negative as well
only two letters away from being an asset
|
|
|
|
|
Hi all,
some of my files are corupted(damaged) in XP.can any one tell me how to repair it or recover it ???
Thanks in advance...
|
|
|
|
|
|
sarangkhandare wrote: some of my files are corupted(damaged) in XP.can any one tell me how to repair it or recover it ???
How does it related with ASP.NET ? You are in a wrong forum !!
|
|
|
|
|
Why don't you repair you installation?
Cheers!!
Brij
|
|
|
|
|
My config:
VS 2005 Pro with SP1
C# 2005
.NET Framework 2.0 SP2
Vista Ultimate SP1 all current patches applied
P4 3.0ghz w/ 1.5GB RAM and (1) 300GB disk w/ 27.5GB free (system/boot disk), (1) 400GB disk w/ 74GB free
Problem: no matter how simple an app I create, debugging does not work - i.e. I can set a breakpoint that I know is crossed but the app does not fall into the debugger. These are .NET web apps. I created one with a single form and created several breakpoints, one in Page_Load against a simple string which I programmatically set a value for and one in an asp:validator that I know is hit and passed.
VS even asks to set the app for debugging, and IE is set to show scripts, etc.
Can someone help me to understand what I'm missing and why I can't debug anything simple or complex? You can probably imagine this is making me crazy and I'm having to write data to textboxes just to see what's happening when something goes wrong. Some things I just can't test for at all because of this.
Thanks in advance!
|
|
|
|
|
Hi Mike..
<%@ Page Language="VB" MasterPageFile="~/........"
AutoEventWireup="true" CodeFile=".....aspx.vb" Inherits="......" title="....." %>
Change autoeventwireup to TRUE and try....
Regards
Rajeesh MP
|
|
|
|
|
Unfortunately, all pages have AutoEventWireup="true", here's a sample of a simple app page:
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ValidaTest._Default" %>]]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Pick a Team Name</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>Pick a name for your team</h2>
Name:
<asp:textbox id="txtTeam" runat="server" xmlns:asp="#unknown" />
<asp:button id="btnValidate" runat="server" text="Go" xmlns:asp="#unknown" />
<br />
<asp:requiredfieldvalidator id="reqval_txtTeam" runat="server" xmlns:asp="#unknown">
ErrorMessage="You must enter a team name."
ControlToValidate="txtTeam" Display="dynamic" />
<asp:customvalidator id="custval_txtTeam" runat="server">
ErrorMessage="That name is already taken. Please pick another."
ControlToValidate="txtTeam" Display="dynamic"
OnServerValidate="custval_txtTeam_ServerValidate" />
<asp:label id="lblResult" runat="server" enableviewstate="false" />
</asp:customvalidator></asp:requiredfieldvalidator></div>
</form>
</body>
</html>
Thanks for trying - it seems to be something deeper. When I press f5, everything executes, just no stopping at breakpoints. The Build is set to Debug as the active, DEBUG and TRACE constants are defined, it's set to full debug mode, any CPU and platform and the ASP.NET debugger is checked.....
Strangest thing.....
|
|
|
|
|
i had same problem, it solved by when i start dotnet framework by right click and run as administrator on VS sort cut or on programs.
you may try this.
Anshuman Singh
|
|
|
|
|
Thanks - that was the answer - for whatever reason, even though my Vista ID is an Administrator, I have to explicitly start VS by running as an Admin by right-clicking. Thanks for fixing me up!
|
|
|
|
|
hi Anshuman..
thatz a good one..Thanks for the information
Regards
Rajeesh MP
|
|
|
|
|
<br />
<br />
CS1502: The best overloaded method match for 'System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(string, string)' has some invalid arguments<br />
<br />
Source Error:<br />
<br />
<br />
<br />
Line 27: <br />
Line 28: objLogin = new STR_USERS(); <br />
Line 29: objLogin.PASSWORD_PRO = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword, "MD5"); <br />
Line 30: objLogin.USERNAME_PRO = FormsAuthentication.HashPasswordForStoringInConfigFile(txtUserName,"MD5");<br />
Line 31: <br />
I don't why I got this error.
|
|
|
|
|
amistry_petlad wrote: Line 27:
Line 28: objLogin = new STR_USERS();
Line 29: objLogin.PASSWORD_PRO = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword, "MD5");
Line 30: objLogin.USERNAME_PRO = FormsAuthentication.HashPasswordForStoringInConfigFile(txtUserName,"MD5");
Line 31:
Assuming txtPassword and txtUserName are TextBox controls, you need to call the .Text property on them. If you attempt, as you have done, to pass references to the controls themselves, you get a compile-time error because the method was expecting an instance of a string, not a TextBox control.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello Everyone,
I am a newbie to the world of ASP.NET and I am trying to create a web based questionnaire/test. The user clicks on a link to start the test and the page that presents itself has questions and appropriate input control (text box or checkboxes, etc) for the user to answer. Based on the type of test that user selects, I have to present the form which gets questions from a database and it can be any number of questions.
I do not know a good way to generate all the required text boxes dynamically, because, I have an aspx file, which just has the page skeleton (header and all) but the remaining content has to be set by the cs file for the form. I have found a way of doing this, but am not sure if (I don't think this is) this is the right way - in my cs file, I create the entire html form using StringBuilder and then set the innerHTML of a div in my aspx. I don't even know if this will work whent he user completes the test and submits it (haven't gotten that far yet) - i.e. I do not know if I'd be able to retrieve the values from text boxes, which are named like txtAnsToQues1, txtAnsToQues2, etc.
Any help or a right direction is appreciated.
(I did search the forum first and came up with some dynamic form results, but none answered what I am looking for - perhaps this is too basic?)
Thanks,
~R
|
|
|
|
|
The easiest way to approach this would be to use a data-bound control like a ListView to display the questions and corresponding input controls. Within the ItemTemplate for your data-bound control, you can declare an instance of each type of input control you want to use (TextBox, CheckBox etc.) Then at run-time, override the ItemDataBound event for your control and show/hide each input control for the current question being rendered as appropriate. On postback, to save the user's input, loop through the Items collection for the control, use FindControl to locate the correct control containing the user's input, then save the information to your database (or whatever)
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|