|
hi,
just try this:
after entering the user id & Pwd, just use this code to know the user login time.
DateTime LoginTime= new DateTime();
LoginTime=DateTime.Now;
private string lstrUserID; // To hold login user id
private string lstrPassword; // To hold login Password
this.lblErrorMessage.Text = "";
lstrUserID = txtUserID.Text.Trim();// Get the Correct User Login Id
lstrPassword = txtPassword.Text.Trim(); // Get the Correct User Password
< write the code for validating the User>
if the credentials are valid (valid user) then, to redirect the user
Response.Redirect("MainMenu.aspx");
}
else
{
lblErrorMessage.Text = "Invalid UserID / Password";(//to display the error message i am using label here, just use according to ur page)
}
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
What is your problem of redirect page?
suresh008 wrote: i want to knoe the login time from the user.can u help me
just get the system date...
<< >>
|
|
|
|
|
Hi,
Got a really annoying problem with downloading a file froma web site.
My code is pretty straight forward:
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + resource.Filename.Replace(" ","_"));
Response.AddHeader("Content-Length", resource.FileSizeBytes.ToString());
Response.ContentType = resource.MIMEType; // "application/octet-stream";
Response.WriteFile(fileToDownload);
//Response.Flush();
//Response.Close();
Response.End();
(You'll notice indications of desperation - randomly commenting code out) I have tried with the actual MIMEType and the application/octet-stream type - same result.
The download fails, and actually downloads the first x bytes of the web page itself, as the following Fiddler trace reveals:
Many thanks for any help you can give.
Nathan
--------------------------------------------------------------------
HTTP/1.1 200 OK
Date: Mon, 12 Feb 2007 19:47:33 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Content-Disposition: attachment; filename=Blue-LogoOnly.gif
Content-Length: 5329
Cache-Control: private
Content-Type: application/octet-stream; charset=utf-8
<title>
Work Connexions | Your Files
|
|
|
|
|
This code works for me (in my button click event handler):
<br />
Response.Clear ();<br />
Response.ContentType = "application/octet-stream";<br />
Response.AddHeader ("Content-Disposition", "attachment; filename=\"foo.jpg\"");<br />
Response.WriteFile (Server.MapPath ("foo.jpg"));<br />
Response.End ();
|
|
|
|
|
I am trying to instantiate a class and am not able to do so (C# Visual Studio 2005).
In frm2, I wrote: private frm2 tmpfrm2; (This works in Visual Studion 2003 but not in 2005)
Help!
|
|
|
|
|
In Visual Studio 2005 if you go to Build menu you'll see an option for "Clean Solution". What exactly does this command do for us and also when should we use it?
Thanks.
Robert
|
|
|
|
|
It moves all the built libraries, executables, object files etc from the solution. Sometimes VS will get it's knickers in a twist with not updating the correct libraries etc and you can use Clean to force it to delete the old version and then next time it compiles you can (more or less) guarantee that the latest code / libraries will be used.
|
|
|
|
|
Hi Everyody,
I want to know what determines the maximum attachment size in an ASP2 web application.
I send an email from a web application & the attachment is about 2 MB.
Whenever I try to send it from the Visual Studio 2005 project,it takes much time then gives me an exception saying that it couldn't be sent & timed out.
It works normally in the VS 2003 application.
Any Clue??
Thnx a lot
|
|
|
|
|
Not sure if you are trying to attach the file from a web interface or if the file is located on the server.
If you are having the user upload the file as attachment then you might have to override the httpRuntime's maxRequestLength value in the web.config file.
By default ASP.NET only allows files with size 4MB [4096 KB] or less to be uploaded but you can change it like this:
<httpRuntime maxRequestLength="8192" />
|
|
|
|
|
Thanks a lot for your response..Actually the file is located on the server. Is there anything else I should change??
|
|
|
|
|
If file is located on the server then I would first check for common things like for instance if the file is locked or not, read access, other error handling code that might cause an infinite loop etc.
Post your code so we can see exactly how you are trying to attach the file. Thanks.
HTH
Robert
|
|
|
|
|
Thanks again Robert.
Actually I create a PDF file in the code,the file is placed on the server but after it is created,it's added automatically to source control..This doesn't happen in VS 2003 though I didn't change anything when converting the project to VS 2005 so I just want to remove a specific folder in the project from the source conttrol (Visual Source Safe) How can I do that??
|
|
|
|
|
You can do the following:
Goto File > Source Control > Exclude "MyFileOrFolderName" from Source Control
You can also exclude that folder from your VS2005 project if it is not directly used in the project that will also take care of the VSS problem.
Hope that helps
Robert
|
|
|
|
|
Thanks again Robert
|
|
|
|
|
You are welcome, hope your problem is fixed
|
|
|
|
|
I am attempting to create a web service that will send and received XML messages via SOAP. I am not certain which way to go on creating my client app. Ultimately , i have an application written in C++ that will have to ultimately receive the message, but is using C++ as a client much more difficult to code than using C#? Any advice or direction is appreciated.
Thanks,
|
|
|
|
|
If you know managed C++, it's not much different.
|
|
|
|
|
I was creating an web app using vs2005 in Vista when I encountered this problem.
The default setting of the password recovery control in the vs2005 only send password through smtp which doesn't require SLL. but what if that smtp,say, smtp.gmail.com, requires SSL?
Is there any solution besides hard coding the "Password Recovery Control" to enable SSL?
Is there any way to modify the code of the "password recovery control"
THanks~
|
|
|
|
|
some times this error was occured in our webserver. whem i made a direct request for a page then it goes to default error page . but again i refresh the page by using browser's refresh button it shows the page correctly. what is the reason behind this case. I thing it related to the server issues. Because other times my codings are running perfectly. if anybody is having same kind of problems then give me your ideas.
Thanks in advance.
|
|
|
|
|
You should catch and log the exception that is being thrown. This will give you a better idea of what is happening. Otherwise it's a bit hard to track down.
|
|
|
|
|
Thanks Paddy Boyd
In our project we are implementing log4net based logging system but in the above case , nothing has to be logged . So i am very much confused. Any other ideas.
|
|
|
|
|
i have a page developed in ASP.NET... i have a function that sometimes take to long to finish and i get a time out for the conection in the proxy...
theres any quick way to make a request in the browser to the server and wait for the result in an assyncronos way??
thanks in advance
|
|
|
|
|
I believe that your problem can be solved by setting a property in the web config. This is what my web config looks like for a site that has a file large upload and long time out for processing:
<!-- The httpRuntime mamRequestLength defaults to 4096 which allows users to upload files that are 4MB or smaller. My site needs up to 5MB for uploading files, so this value needs to be set to 5120. <br />
<br />
The executionTimeout is set to override the default, since some pages will take a much longer time to load. (I believe this is measured in seconds) --> <br />
<httpRuntime maxRequestLength="5120" executionTimeout="900"/>
Hope this helps.
|
|
|
|
|
Respected Gurus
I have 3 web pages
1.frmShowallproducts --Shows all product's records
2.frmCondition--Is a modal dialog box(Retrieves the Product's name)
3.frmShowSearchedProducts--Shows the records of the selected product)
As 2nd one is a modal dialog.On click of a button i want to close it as well as 1st one and redirect to the third one.
As after opening the modal box rest of the pages are coming in the same height and width......
How to do that
Am i going right..
If there is any other way through which i can successfully search my products..
Plz help me...
Ajay
|
|
|
|
|
Are you searching the product or record ?
On what basis do you want to search i.e name,id ?
is it stored in the database ?
What type of query you have written ?
<l>Thanks and Regards
Sandeep
|
|
|
|