|
hi everyone.
I have used session and cookie for login users with ASP.NET 1.1
and wrote:
<br />
Dim c As New HttpCookie("username")<br />
c.Value = r("company")<br />
c.Expires = Now.AddMinutes(30)<br />
Response.Cookies.Add(c)<br />
Response.Redirect("Main.aspx")<br />
r is an objects of SqlDataReader class. however when the user login an go to the main page on there I'v used a linkbutton as a logout order. and the code there is:
<br />
Request.Cookies.Remove("username")<br />
Request.Cookies("username").Expires = Now<br />
Response.Redirect("Login.aspx")<br />
and on the load event of login page:
<br />
If Request.Cookies("username") Is Nothing = False Then<br />
Session("user") = Request.Cookies("username").Value.ToString<br />
Response.Redirect("Main.aspx")<br />
Else<br />
Session("user") = Nothing<br />
End If<br />
but it dosen't works! and
Request.Cookies("username") Is Nothing = True !!!
Do I wrote the correct code or not ?
if exists another way plz help.
thanks
|
|
|
|
|
masoodp666 wrote: but it dosen't works! and
Request.Cookies("username") Is Nothing = True !!!
This is correct, isn't it? When the user logs out, you delete the cookie and redirect to the Login page. When the Login page loads, you check for the presence of the cookie. If the cookie has been removed, any attempt to refer to the cookie will return a null reference.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
oh excuse me !!!
I said
<br />
If Request.Cookies("username") Is Nothing = False<br />
when I'v deleted the cookie, Request.Cookies("username") Is Nothing MUST BE True, not False! and execute go to Else command.
modified on Monday, February 11, 2008 5:40 AM
|
|
|
|
|
I got it finally !!!
replace:
<br />
Request.Cookies.Remove("username")<br />
Request.Cookies("username").Expires = Now<br />
Response.Redirect("Login.aspx")<br />
With this:
<br />
Response.Cookies("username").Expires = Now<br />
Response.Redirect("Login.aspx")<br />
|
|
|
|
|
how to get file from internet by using the webclient
Dim Client As New WebClient()
Client.DownloadFile("http://www.yahoo.com", "D:\abc\yahoo.html")
when i run this code i am getting out put yahoo.html page when i run this code local host
if i host in remote server i want to download the same page in D:\ or any other directory what i need to give the path.
i getting exception when i run the same code in server.
i am getting out put successfully , when i run local host , pleasee any one can give me solution for this, i want to download file in my local phisical directoy, when i host my dotnet application in remote system.
This is haneef.............................................................
|
|
|
|
|
Wow, you have you posted your message on every forum? Did you think this would increase the chances of your question being answered?
Wrong - double posting only serves to annoy people and results in your message being ignored. Read the foum guidelines and think before you post again.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Do NOT post the same question in multiple forums. Doing so is considered very rude around here and on other sites as well. And, as you've found out, it doesn't get your question answered any faster.
|
|
|
|
|
I've built a product list which I want to extend with some images. I have only 1 table and 1 dataset and i'm showing the products in a gridview. You can watch it @ http://www.rapengaarmaken.nl/.
Users with a administrator role can insert new products. I want to make it possible to upload a image with each product. The gridview should only let me see a thumnail. When I click on the thumbnail the image will be opened in a new window.
I already added a column "image" in my products table. Also I've already set the datatype to image. Did that means the picture will be uploaded into the database? I want him to upload the images to a specific folder in my root.
Can somebody tell me how I can add this image functionality?
|
|
|
|
|
I have uploaded a page on the server.when i am viewing it online,it gives me server error with a following error.
Server Error in '/xxxx' Application
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customerrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customerrors> tag should then have its "mode" attribute set to "Off".
<configuration>
<system.web>
<customerrors mode="Off">
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.
<configuration>
<system.web>
<customerrors mode="RemoteOnly">
coolsatty
|
|
|
|
|
From your web.config, disable customerrors to get details of the actual error.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
still i am getting the same error
coolsatty
|
|
|
|
|
Then you're doing something wrong. Set customErrors to 'Off'.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hey all,
i am using content pages into master page,these pages needs to be validated through javascript,does it possible to inject javascript file into master page and use all of the functions in content pages.
please help me.
|
|
|
|
|
|
Hi,
I got the following error when I was doing some tests on the treeview control. I have a site that consists of a default.aspx that is divided into frames. In my left frame I have a menu in the form of a TreeView. The TreeView has the web.SiteMap as datasource. When running the website and clicking the '+' or '-' to expand or collapse the tree I get the following error in firebug: "TreeView_Toggle node is not defined" and IE6s script debugger popups with the following message: "'TreeView1_data' is undefined".
If I remove all the frames and put the treeview in default.aspx it will work so it is really confusing. I don't think I will use frames in the future but I do want to know why I get this error to better understand the framework.
Thanks,
--Tomas
|
|
|
|
|
I found a way to make it work but I still don't why it didn't work to start with. The problem was the <base target="MainFrame" /> that I had in the head on my aspx-page. If I removed that tag and instead used the Target property of the TreeViewe control it worked just fine.
Does anyone know why it doesn't work with the base tag in the head of the page?
--Tomas
|
|
|
|
|
Put ypur treeview into another aspx page, and create a iframe to refer the page, it will work.
and so intereting that, you can have this test. still leave your treeview on the page. say: tree1 in the main page, tree2 in another page which is refered by the iframe, click on the tree1. check tree2.
nodes of tree2 will expand by clicking on tree1.
|
|
|
|
|
to retrieve text from the uml class diagam and to estimate the size
|
|
|
|
|
Ok...? What part of writing this code are you having problems with? Post your code, and show us where the problem is.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Hi!
1)I am very confused to get the concept of MVC (Model View Control).Could u tell me what is
this MVC Model is all about?
2 ) How to implements MVC Model to the apiaction? could u tell me the steps.
|
|
|
|
|
is Google[^] not working where you live? Any one of those links will tell you what you need to know.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Hi,
I want to develop an application, wher on each users login some data has to get displayed. But it should not be same for any two.
example let us assume I have 10 rows of data in database. i.e. d01, d02, d03,d04,d05.....etc. and there are 5 users u1, u2, u3, u4, u5.
when u1 logins data or d01 has to get display in his login. then when next user logins next row data has to get displayed.
If d06 is completed in one day, next day when the user logins it has to start with data of d07.
I am not getting any idea how to start with, any suggestions will be appreciated.
Thanks in advance
|
|
|
|
|
Hi n_gchaitra!
I think you have to store the last status of the data that has been displayed to particular user.
Proper table structure in DB may solve your problem.
Regards.
|
|
|
|
|
Thank you. But how?
Chaitra N
|
|
|
|
|
1st of all ur question is not well described from here,
n_gchaitra wrote: If d06 is completed in one day, next day when the user logins it has to start with data of d07.
But I think U need a something like LOGIN in which
Some user has a Id and logs in then he/she can see the details related to that particular id?
bu here u want something like a user can see two data Means d01,do6 for U1?Is it so?
Do u want to build like this?
Believe Yourself™ :->™
|
|
|
|