|
The reason that you can't do anything else while the file is uploaded, is that the web server only allows one page at a time to run for each user.
The solution is to disable SessionState for one of the pages.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi Guffa,
Thanks for updating me.I tried it in sample application and it worked fine. I found that, two saperate pages processed simultanenously using different threads.
But when i tried it in my application, it didn't worked.
I disabled sesionState for "Upload File" page, which open in popup window. Now, if uploading is going on and at the same time, if i wanted to do different things on different pages, then i found that, request were queued. I am not getting, where i am going wrong. Can you guess, what other settings may cause this to not happend?
Is there any other way to achieve the same without disabling the SessionState?
Means by managing threads in code.
Thanks
Lokesh Gupta
|
|
|
|
|
lokeshgupta13 wrote: Thanks for updating me.I tried it in sample application and it worked fine. I found that, two saperate pages processed simultanenously using different threads.
Then one of them is not processing the page any more, just running in the background. Once you end the response, it doesn't matter if you have a thread running in the background. This of course means that the background thread can't send anything to the browser any more, as the response has ended.
lokeshgupta13 wrote: I disabled sesionState for "Upload File" page
Is that the page containing the upload form, or the page that is recieving the file? Or are they the same? The page recieving the file has to be sessionless, as that's the one running while the file is uploading.
I have myself written an upload application that used a sessionless page for displaying upload progress, so I know that it's possible to do it this way.
lokeshgupta13 wrote: Is there any other way to achieve the same without disabling the SessionState?
Not unless you can get rid of the single page limitation in the IIS, but I really doubt that is possible. That could introduce threading issues, as you will have several threads running against the same session object. Also it would make the server much more sensetive to DoS attacks.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
In my case both the "Upload Form" and "Receiving form" are the same. I am using same form. I am not getting what is going wrong.
Thanks
|
|
|
|
|
Have you verified that trying to access the Session object in the page gives an excception, so that you are sure that the page is session-less?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Yes, i tried and it throughs an exception.
|
|
|
|
|
i am using vs2003
i want to write some text into an existing file present at server side using asp.net but it gives me an exception named
----->System.UnauthorizedAccessException: <------
so i need how to get permission to write file to server
any suggestions are also welcome
the code i used is given below---
Dim fs As New FileStream("C:\Inetpub\wwwroot\wa_readfromcsv\textfile_as_csv.txt", FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("This is an example of using file handling concepts in VB.NET.")
s.WriteLine("This concept is interesting.")
s.Close()
------- the exact error shown is ---------
' Exception Details: System.UnauthorizedAccessException:
' Access to the path "C:\Inetpub\wwwroot\wa_readfromcsv\textfile_as_csv.txt" is denied.
'ASP.NET is not authorized to access the requested resource.
'Consider granting access rights to the resource to the ASP.NET request identity.
'ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5
'or Network Service on IIS 6) that is used if the application is
'not impersonating. If the application is impersonating via <identity impersonate="true">,
'the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
'To grant ASP.NET write access to a file, right-click the file in Explorer,
'choose "Properties" and select the Security tab.
'Click "Add" to add the appropriate user or group.
' Highlight the ASP.NET account, and check the boxes for the desired access.
thanks in advance for your help and time...
|
|
|
|
|
The error message tells you what you need to do. Basically, the ASPNET user does not have write permissions for this directory. You need to grant this user permissions to the directory. Follow the instructions in the error for granting ASPNET access.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: The error message tells you what you need to do
There are none so blind as those who will not see.
|
|
|
|
|
thanks for your reply ..
about the suggested solutions
for first suggested way--- i dont know how to grant permission to the user .
for second way--- i dont think that changing in my system will solve the problem globally because application is web application .does the second solution mean that i need to change in explorer of system where i installed the application ...i dont think so ..even thought i do it is something like i will only use the application at client side it appears...
...so please explain me clearly what the error message says me to do.
|
|
|
|
|
rama charan wrote: about the suggested solutions
for first suggested way--- i dont know how to grant permission to the user .
for second way--- i dont think that changing in my system will solve the problem globally because application is web application .does the second solution mean that i need to change in explorer of system where i installed the application ...i dont think so ..even thought i do it is something like i will only use the application at client side it appears...
...so please explain me clearly what the error message says me to do.
OK - as you are running this as a web application, then fixing it at the server is enough. Right-click on the directory that you are trying to write this file to, choose Properties and select the Security tab. Click the Add button and choose the ASPNET (if you are running IIS5) or Network Service (if you are running IIS6) user. This user is a local account. Select OK and then choose the relevant permissions at the bottom of the properties dialog. Once you have chosen the permissions to grant, click OK.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
that was a very clear description thank you very much
but its still not working ....
what does this mean in the error description something with "impersonating"..
" that is used if the application is
'not impersonating. If the application is impersonating via ,
'the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user"
i dint get exactly which user to modify ...just assume that i am using a simple webiste and its accessible to all ..so no authentication.
but may be the code has any issue please check the 5 line code also
assume file is already present.
thanks for your effort..
|
|
|
|
|
T-SQL transaction vs ADO.NET transactions
What is the better to use between them?
waiting for prompt reply
|
|
|
|
|
Dinuraj wrote: waiting for prompt reply
Please don't put things like this into a question. The people on this site give their help freely, and in their own time. If somebody can answer you, they will.
Anyway, you would use a T-SQL transaction when you can accomplish everything inside the same top level stored procedure. ADO.NET transactions allow you to wrap multiple stored procedures into the same logical transaction.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi all,
I want to publish my web site and i dont want users to be able to see my connection string in web.config. How can i do that in an easy & simple way. Any encryption code or another way?
Thanks
SH
|
|
|
|
|
The code you need to encrypt/decrypt your connection strings section in your web.config file looks like this:
public void EncryptConfigSection(bool bEncrypt)
{
string pathToConfigFile = "~/";
Configuration config = WebConfigurationManager.OpenWebConfiguration(pathToConfigFile);
ConfigurationSection connStrings = config.GetSection("connectionStrings");
if (true == bEncrypt)
connStrings.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
else
connStrings.SectionInformation.UnprotectSection();
config.Save();
}
Sebastian M.
|
|
|
|
|
Hi there,
.NET supplies System.Security.Cryptography namespace to do that...
<< >>
|
|
|
|
|
hi
i want to validate a Textbox which is in a webpartZone, i am able to do that when my aspx page is not inheriting from master page, but when I am using a aspx page with master page and my Textbox in side a webpartZone I am not able to valdate the text box .it through an error Unable to find control id 'TextBox1' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1' please give some .
Regards
Smruti
Smruti
|
|
|
|
|
Hello.
Do you have another "TextBox1" somewhere on your page? Perhaps in the Master page itself? If so - ASP.NET renames the controls in order to get a unique ID. It should automatically rename your RequiredFieldValidator1 reference to the control as well. But perhaps this does not happen as expected. Anyway you should go check it out. I've found the best way to debug this, is to try and rename your control to something logic eg. "txtName" - that way you ensure, that you decide the names, and not Visual Studio, because, well, it's best the other way around.
Best Regards
Soeren
|
|
|
|
|
Dear All
I want to creat a regular expression for a dropdown list
My first item in the dropdown list is "Please Select One..."
So i want to create a regular expression to validate this
i mean, i don't want to keep the dropdownlist with it's default selected value, i want to force the user to select one item
And if there is a better solution for that, please tell me about it
Thanx in advance
Best Regards
3ala2
|
|
|
|
|
Hi
you have to use requiredfieldvalidator and set the property Initialvalue = "Please Select One..."
Regards
smruti
Smruti
|
|
|
|
|
try this javascript and let me know....
function ValidateDegree(source,arguments)
{
if (document.Form1.DDLDegreeName.value == 0)
{
arguments.IsValid=false;
return false;
}
else
{
arguments.IsValid=true;
}
}
<asp:dropdownlist id="DDLDegreeName" runat="server" width="330px">
<asp:customvalidator id="CustomValidator1" runat="server" errormessage="Choose Degree" display="Dynamic"
clientvalidationfunction="ValidateDegree">
|
|
|
|
|
Thanx for the quick response
Where to put this code?
samerh wrote: ClientValidationFunction="ValidateDegree">
and what event to call the previous one?
and what if i had other valdators? would they still work fine?
Thanx again
Best Regards
3ala2
|
|
|
|
|
use custom validator with ClientValidationFunction="ValidateDegree".
It will work.
Man i need a favor on Any idea on how to encrypt password in web.config?
<asp:dropdownlist id="DDLDegreeName" runat="server" width="330px">
<asp:customvalidator id="CustomValidator1" runat="server" errormessage="Choose Degree" display="Dynamic"
="" clientvalidationfunction="ValidateDegree">
|
|
|
|
|