Showing posts with label users. Show all posts
Showing posts with label users. Show all posts

Saturday, March 31, 2012

strange & weird problem in ASP.NET application

I am having a strange problem in my ASP.NET application. When
multiple users access the web site, the changes done by a user gets
reflected in another users session.

I have some global variables declared in a module which I use
throughout the application. Is it problem because of this? If I cant
declare a global variable in a module where else can I declare it
where it cannot be changed when multiple users are accessing the same
variable?

Please somebody help me.

-Shalinthat would be the difference betueen session variables and application
variables
you would need session variables
have a look at the pass variables value between diferent pages thread

hope it helps

eric

"shalin" <shalin@.imagine.co.in> wrote in message
news:2acc1eb4.0402260345.4dd44352@.posting.google.c om...
> I am having a strange problem in my ASP.NET application. When
> multiple users access the web site, the changes done by a user gets
> reflected in another users session.
> I have some global variables declared in a module which I use
> throughout the application. Is it problem because of this? If I cant
> declare a global variable in a module where else can I declare it
> where it cannot be changed when multiple users are accessing the same
> variable?
> Please somebody help me.
> -Shalin

strange 404 in ASP.NET IIS5

I have been receiving this very strange 404 lately and was wondering
if anyone else out there has had a similar problem. For some reason
when users receive this error and they hit refresh the error goes
away. Seems like a IE or ASP.NET cache problem, but can not find any
articles on it.

404 not found C:\inetpub\mySite\mySite_com_files\pictures.aspx

StackTrace
System.Web.UI.TemplateParser.GetParserCacheItem() at
System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String
virtualPath, String inputFile, HttpContext context) at
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) at
System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context) at
System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
String requestType, String url, String path) at
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)

-MikeOh yeah, sometimes instead of mySite_com_files it will be a username_com_files or username_files. _files is on all these 404's no matter what was before it.

-Mike

-- Mike wrote: --

I have been receiving this very strange 404 lately and was wondering
if anyone else out there has had a similar problem. For some reason
when users receive this error and they hit refresh the error goes
away. Seems like a IE or ASP.NET cache problem, but can not find any
articles on it.

404 not found C:\inetpub\mySite\mySite_com_files\pictures.aspx

StackTrace
System.Web.UI.TemplateParser.GetParserCacheItem() at
System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String
virtualPath, String inputFile, HttpContext context) at
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) at
System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context) at
System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
String requestType, String url, String path) at
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)

-Mike

Wednesday, March 28, 2012

Strange character transformations

Hi,

I have an ASP.Net website, which allows users to upload a file which is
then inserted into a database.

This is all fine until it reads a line with the string +Anu in it.
It transforms this to this char ? (which, if Googled for, is
described as Unicode Character 'LATIN SMALL LETTER TURNED R WITH HOOK'
(U+027B) or, in Phonetics, as a 'Retroflex approximant'.)

Has anyone seen this behaviour before, and know how to stop it?
The code's simple - here's an example. The ? appears in the output
where the input is +Anu - it's transformed before I can touch it!

using (StreamReader sr = new StreamReader(strFile,
System.Text.Encoding.UTF7)) {
// Read and display lines from the file until the end of the file is
reached.
while ((line = sr.ReadLine()) != null) {
Response.Write(line);
}
}

Regards

AdamLooks like an encoding issue, alright.
Have you tried using the StreamReader constructor that does not require a
character encoding?

"CyberSpyders@.gmail.com" wrote:

Quote:

Originally Posted by

Hi,
>
I have an ASP.Net website, which allows users to upload a file which is
then inserted into a database.
>
This is all fine until it reads a line with the string +Anu in it.
It transforms this to this char ? (which, if Googled for, is
described as Unicode Character 'LATIN SMALL LETTER TURNED R WITH HOOK'
(U+027B) or, in Phonetics, as a 'Retroflex approximant'.)
>
Has anyone seen this behaviour before, and know how to stop it?
The code's simple - here's an example. The ? appears in the output
where the input is +Anu - it's transformed before I can touch it!
>
using (StreamReader sr = new StreamReader(strFile,
System.Text.Encoding.UTF7)) {
// Read and display lines from the file until the end of the file is
reached.
while ((line = sr.ReadLine()) != null) {
Response.Write(line);
}
}
>
Regards
>
Adam
>
>


Graven,

I'm not sure how a 4 letter string like this could be seen as an
encoding issue, but I will certainly give it a go. Thanks for the
suggestion.

Adam

Graven wrote:

Quote:

Originally Posted by

Try to use plain latin-1 encoding. I think it's an unicode
normalization issue, but don't know if StreamReader performs it by
default.
>
>
CyberSpyders@.gmail.com wrote:

Quote:

Originally Posted by

Hi,

I have an ASP.Net website, which allows users to upload a file which is
then inserted into a database.

This is all fine until it reads a line with the string +Anu in it.
It transforms this to this char ? (which, if Googled for, is
described as Unicode Character 'LATIN SMALL LETTER TURNED R WITH HOOK'
(U+027B) or, in Phonetics, as a 'Retroflex approximant'.)

Has anyone seen this behaviour before, and know how to stop it?
The code's simple - here's an example. The ? appears in the output
where the input is +Anu - it's transformed before I can touch it!

using (StreamReader sr = new StreamReader(strFile,
System.Text.Encoding.UTF7)) {
// Read and display lines from the file until the end of the file is
reached.
while ((line = sr.ReadLine()) != null) {
Response.Write(line);
}
}

Regards

Adam


Larry,

You were spot on - changing to UTF8 stopped this transformation. Thanks

It's not quite solved my problem though.
The file is a Text file, each line being a series of files delimited by
the character, as this was unliekley to ever appear in the actual
data.

Unfortunately, UTF8 encoding strips these characters completely. ASCII
encoding, on the other hand, replaces them with ?

Oh the joy of character encoding.

Regards

Adam

Larry Lard wrote:

Quote:

Originally Posted by

This is why you are seeing what you are seeing. UTF7 encodes characters
outside the printable 7 bit range using UTF16 then modified base64, with
+ as the indicator mark for this encoding. I haven't checked, but I
imagine +Anu is the UTF7 encoding of that character. You shouldn't use a
UTF7 reader to read a file that you don't know for sure was produced by
a UTF7 writer.
>
The correct way to read the file depends on what kind of file it is. If
it is text of an unknown encoding, there is no way to be absolutely
sure, but UTF8 is a good starting point. If it's binary data, you
shouldn't be using a TextReader class at all.

Thursday, March 22, 2012

strange login occurrence

hey all,

i have an asp.net app and i create a login.aspx page for it, i changed the
web.config to windows forms authentication and deny users="?" for
authorization. i browsed to a page and got redirected to login several times.
that's perfect.

well, i had to run the data adapter wizard again to bring in some database
changes i made and now i don't get redirected to the login page when i try to
browse directly to a page.aspx.

any ideas why the login isn't working all of a sudden?
thanks,
rodchari think i may have figured it out. when i delete my cookies it works the way
it should. can you tell how new i am to this?

thanks.

"rodchar" wrote:

> hey all,
> i have an asp.net app and i create a login.aspx page for it, i changed the
> web.config to windows forms authentication and deny users="?" for
> authorization. i browsed to a page and got redirected to login several times.
> that's perfect.
> well, i had to run the data adapter wizard again to bring in some database
> changes i made and now i don't get redirected to the login page when i try to
> browse directly to a page.aspx.
> any ideas why the login isn't working all of a sudden?
> thanks,
> rodchar

strange login occurrence

hey all,
i have an asp.net app and i create a login.aspx page for it, i changed the
web.config to windows forms authentication and deny users="?" for
authorization. i browsed to a page and got redirected to login several times
.
that's perfect.
well, i had to run the data adapter wizard again to bring in some database
changes i made and now i don't get redirected to the login page when i try t
o
browse directly to a page.aspx.
any ideas why the login isn't working all of a sudden?
thanks,
rodchari think i may have figured it out. when i delete my cookies it works the way
it should. can you tell how new i am to this?
thanks.
"rodchar" wrote:

> hey all,
> i have an asp.net app and i create a login.aspx page for it, i changed the
> web.config to windows forms authentication and deny users="?" for
> authorization. i browsed to a page and got redirected to login several tim
es.
> that's perfect.
> well, i had to run the data adapter wizard again to bring in some database
> changes i made and now i don't get redirected to the login page when i try
to
> browse directly to a page.aspx.
> any ideas why the login isn't working all of a sudden?
> thanks,
> rodchar