|
I have two text boxes for login (not using ASP.NET2.0 login control) for username and password and one checkbox for "Remember Password".I want to remember password on the check of checkbox.
Do I have to use cookies?Is there any other way to achieve that since if the user had disabled cookies then this can't be achieved.
I have tried it with cookies but not able to succeed,can anybody suggest me the code ...
no matter its using cookies or not......
my code is
protected void btnLogin_Click(object sender, EventArgs e)
{
try
{
HttpCookie myCookie = new HttpCookie("myCookie");
Response.Cookies.Remove("mycookie");
Response.Cookies.Add(myCookie);
myCookie.Values.Add("UserName", txtUserName.Text.ToString());
myCookie.Values.Add("Password", txtPassword.Text.ToString());
DateTime dtxpiry = DateTime.Now.AddDays(15);
if (chkRememberPassword.Checked == true)
{
if (Request.Cookies["myCookie"] != null)
{
HttpCookie getCookie = Request.Cookies.Get("myCookie");
string userName = getCookie.Values["UserName"].ToString();
string password = getCookie.Values["Password"].ToString();
}
}
for storing and using cookie and if page is valid
if (Page.IsValid)
{
if (validateuser != null)
{
Response.Redirect("abc.aspx");
}
else
{
lblErrorMessage.Visible = true;
lblErrorMessage.Text = "InvalidUser";
}
Thanks in advance,
modified on Thursday, March 13, 2008 12:27 AM
|
|
|
|
|
salon wrote: Do I have to use cookies?
Yes, unless the user has a static IP address, and you use that and store in your DB.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Have you tried this
FormsAuthentication.SetAuthCookie(username,true);
the second parameter will create a persistent cookie
|
|
|
|
|
Hi!
i ran into simple problem
Below formats correctly,
<%#DataBinder.Eval(Container.DataItem, "writtendownvalue", "{0:#,###}")%>
but i need to add the value and show as a total so i did
<%#AddWDVToTotal(CInt(DataBinder.Eval(Container.DataItem, "writtendownvalue", "{0:#,###}")))%>
Protected Function AddWDVToTotal(ByVal value As Integer) As String
totalWDV += value
Return value.ToString()
End Function
but it doesnt format. could someone please help what i am doing wrong. thanks
|
|
|
|
|
I am having some difficulty with the video:
"How Do I: Get Started with the ASP.NET AJAX Control Toolkit?"
( http://www.asp.net/learn/ajax-videos/video-76.aspx )
"Learn how to extend your ASP.NET AJAX applications using the ASP.NET AJAX Control Toolkit. This video starts with the very basics, including downloading and installing the toolkit, and adding a few of its controls to a simple ASP.NET AJAX-enabled web page."
The demonstration involves building the TemplateVSI
[IMG]http://i67.photobucket.com/albums/h292/Athono/AjaxControlToolkit.jpg[/IMG]
I have followed the instruction closely but I still got this error:
[IMG]http://i67.photobucket.com/albums/h292/Athono/error.jpg[/IMG]
|
|
|
|
|
|
Hey all.
I have a small JavaScript function that needs to be executed on each tick of my Timer control. However, there is no "OnClientTick" property similar to the "OnClientClick" property for Buttons, ImageButtons, etc. How can I go about doing this?
Thanks, in advance, for any help.
|
|
|
|
|
Timer is an ASP.NET server control. You need to use the JavaScript method setInterval on the client-side
only two letters away from being an asset
|
|
|
|
|
I see. Thank you very much.
In that case, I have a more general question.
I have an AJAX UpdatePanel that updates as a result of a Button click or Timer tick within the UpdatePanel. I need my JavaScript function to execute every time the UpdatePanel updates. How can I go about doing this?
Thanks again, in advance.
|
|
|
|
|
button click is easy, provide a client-side method that calls your JavaScript.
only two letters away from being an asset
|
|
|
|
|
Hello,
I have an application that sets a cookie (for authentication purposes) after a user logs in. When I run the application locally it sets the cookie and runs as it should. However when running on the webserver it appears to not set the cookie and cause me to go back to the login screen (to basically do it over). I tested my app in Firefox and it sets the cookie fine (both locally and on the webserver). Can anyone give any insight on this? Thanks in advance.
|
|
|
|
|
Hi,
I have a asp.net page that uses some ASPNET AJAX controls in Update panel. This page keeps throing this exception. I have checked EventValidation is not set in web.config and i even tried explicitly setting it to false but no luck.
If any of you know how to fix this problem please let me know. Thanks a lot in advance.
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 12/03/2008
Time: 12:21:06
User: N/A
Computer: 148424-WWW1
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 3/12/2008 12:21:06 PM Event time (UTC): 3/12/2008 12:21:06 PM
Event ID: a226283c7f45419abc2faaea7489e416 Event sequence: 5570
Event occurrence: 7 Event detail code: 0 Application information:
Application domain: /LM/W3SVC/1513945806/Root-4-128497260244773750
Trust level: Full Application Virtual Path: /
Application Path: D:\Inetpub\Websites\WorldTransfer\
Machine name: 148424-WWW1 Process information: Process ID: 3612
Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE
Exception information: Exception type: ArgumentException
Exception message: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Request information:
Request URL: http://www.worldtransfer.co.uk/online/booking/BookingCentre.aspx
Request path: /online/booking/BookingCentre.aspx
User host address: 81.143.113.148 User: Is authenticated: False
Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information: Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
at System.Web.UI.WebControls.TextBox.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Cheers
Sandy
|
|
|
|
|
Hi everybody
How can I build a flash menu that reads its data from a database
Thanks alot..
and a Web Developer in Jedda Int'l Computer Center(JICC)
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
Hi everybody
How can I build a menu that reads its data from a database
Thanks alot..
Love you all
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
Only one post is enough, any more and you just get ignored. Delete the other.
Have you even tried a rudimentary search for this topic?
only two letters away from being an asset
|
|
|
|
|
You can use inbuilt ASP.NET menu control. Default it uses a web.sitemap file. But you can attach your own providers to that. Write your own provider class and attach. Set the SiteMapDataSource to your new provider name.
|
|
|
|
|
hi,
i have created a database where information on the web page is pulled out from the database using asp.net and have an sql server database. however i need to add javascript functionality to it. the javascript functionality i want to add is a timed text one. does anyone have any suggestions as to how i can achieve this and what is the best way to do it, eg, use dataview, gridview and how i can link the javascript to it. if anyone thinks it would be easier for me to post up some of my code then i will upon request. i hope i have posted this is the right place, if not i will move it to the asp.net bit.
thanks for any help given, it is much needed
|
|
|
|
|
You need to clarify your terminology and understand what you are talking about before anyone else can understand you
young345 wrote: information on the web page is pulled out from the database using asp.net
You don't pull data from a database using ASP.NET. Most likely you mean ADO.NET
young345 wrote: however i need to add javascript functionality to it.
To what? The database? That is how your sentence is structured.
young345 wrote: the javascript functionality i want to add is a timed text one.
What do you mean? What do you want to do?
Subject: javascript and database
Though I applaud you for more than just saying "Help" or "Urgent help, Plz", your question is about adding javascript to a page, not about databases.
only two letters away from being an asset
|
|
|
|
|
hi,
i have data in a database, i display this data on the webpage currently using a datalist.
what i would like to do is add my javscript timed text method i have written to this data list so that the data from the database appears in a sequence on screen. for example, after 2 secs a line appears, then after 5 secs another line appears etc.
however, if someone can suggest another way for the text from the tables of the database to appear in a dynamic fashion like i described before i would really appreciate any examples. or can anyone suggest how i can achieve adding my javascript method to the data from the database. i hope this is more clear for you to understand and that you can offer me some help. if anyone still doesnt understand i will try again at explaining.
|
|
|
|
|
A much more articulate description and question.
The first thing I would ask is why do you need to display the data this way? This is a web app correct? Think of the users and load on your server if you are constantly going back to get one row of data at a time. Yes, you can do it, but is it a good idea or a good design. Just because you can doesn't mean you should.
One way to do this would be to transmit the entire datatable on the first call and store it in some JavaScript object then set off a timer that does what you want on the client side.
Another way would be using AJAX to call a server method that returns the row of data when the timer event kicks off. Though again, this puts load on your server.
only two letters away from being an asset
|
|
|
|
|
i just want to do it so that the page isnt static and has some dynamic functionality to it.
i am a bit of a novice, do you have any examples that could help me do this, i have my javascript method which times when the text appears, but i dont know how to apply it. please could you help me or provide any examples. also can you advise what type of dataMethod i should use, for example a datalist, details view, grid view etc. i would really appreciate your help as i have been struggling with this for some time. i think your first suggestion would be better to use maybe
thank you
|
|
|
|
|
young345 wrote: i just want to do it so that the page isnt static and has some dynamic functionality to it.
I'll repeat what I said; just because you can, doesn't mean you should.
Trying to display one row at a time isn't dynamic, it's stupid.
young345 wrote: can you advise what type of dataMethod i should use, for example a datalist, details view, grid view etc.
Here we are back to not knowing what you are talking about. DataList or GridView are not DataMethods, they are controls that display data.
Go get a book, like Beginning ASP.NET, and read through it, do the examples, then come back here and ask articulate questions about what you don't understand.
only two letters away from being an asset
|
|
|
|
|
how to send mail using sql triggers
This is haneef.............................................................
|
|
|
|
|
Go throught xp_sendmail extended stored procedure.
You can do it another way, create CLR stored procedure and you can use it in Triggers.
Haneef, I did not do more R & D with above said idea, so before going to implementation go through google for more infomation.
If you find any issues then let me know.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
First step is to pick the correct forum. This is a SQL question, use the SQL forum
only two letters away from being an asset
|
|
|
|