Showing posts with label odd. Show all posts
Showing posts with label odd. Show all posts

Monday, March 26, 2012

This is very odd?? cant think of a descriptive title(files opened in different folder, ign

Hello all,
Sorry about the rubish title, this problem has really confused me. Here we go....
(not valid web addresses below, just an example)
I created a page called thepage.aspx in the web folder Myweb.co.uk/sites/thepage.apsx when i openwww.myweb.co.uk/sites/thepage.aspx, for some reason the page that is opened iswww.myweb.co.uk/different/folder/thepage.aspx (but the browser address bar displays the correct address)

thepage.aspx, could be default.aspx or contact.aspx, so for different sites desplays different info. Why would the browser goto the address and instead of reading the file thats right in front of it, go to a totaly differnt folder, and find a file with the same name and display that?
Please can someone help me on this odd event... i am extreamy puzzeled and cant think of any reason why?
Thank you for your time
Darren.breenen--
Regarding this...

breenen wrote:


...Sorry about the rubish title, this problem has really confused me. Here we go....
(not valid web addresses below, just an example)
I created a page called thepage.aspx in the web folder Myweb.co.uk/sites/thepage.apsx when i openwww.myweb.co.uk/sites/thepage.aspx, for some reason the page that is opened iswww.myweb.co.uk/different/folder/thepage.aspx (but the browser address bar displays the correct address)...Please can someone help me on this odd event... i am extreamy puzzeled and cant think of any reason why?...


...it looks like the site where you are building your page has subdomains and/or virtual directories setup...
...your hosting provider should be able to give you the actual map of apparent-names to actual-locations...
...in short, the general idea behind a virtual directory is that one can create a directory namedhttp://LocalHost/MySite and then make that "virtual directory" point to the actual-directory of c:\myMachineName\MyFolder\MySubFolder\ , or any other local physical directory. This allows one to create "friendly" site names and it makes it easier to create/delete/change the physical locations of a site without having to change the "virtual" address. The odd part is that depending upon how one accesses the files, one may see the virtual-path or the actual-path at a given time, which is what seems to be happening to you.
Sub-domains are similar to and leverage the concept of a virtual directory with the added affect that they can be "piggy-backed" off of an existing domain name. Suppose that one owns the domainhttp://www.WebLogicArts.com then that person can create any number of "sub-domain names" based on that domain, (provided the hosting company allows that), and those sub-domains would look generally like thishttp://MySubDomain1.WebLogicArts.com ,http://MySubDomain2.WebLogicArts.com ,http://MySubDomain3.WebLogicArts.com and so on.
HTH.
Thank you.

Thursday, March 22, 2012

Thread Error

I get this thread error in my custom error log. It occurs on a
Response.Redirect statement. The odd thing it does not seem to affect
the functionality of the application at all. What causes this error:

System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
at System.Web.HttpResponse.Redirect(String url)
at contact911.planpayment.ProcessOrder() in C:\Inetpub\wwwroot\dirname\payment.aspx.vb:line 344.net pages run as programs, since you redirected the user, the program stops running.
This doesn't always happen though, its actually rare (it happens on two of my pages out of about 50). Why would the page still be running when the redirect occurs?
well it's not that the others r still running, just that exception while closing them wasnt thrown, lookig at it again, it seems like the error is when the thread tries to abort, but is already aborting.. perhaps something to do wih how quickly things are executed.

there is likely nothing you can do about it though, the exception comes from within the redirect statement, not your code.

The other possibility i can think of is perhaps if you have code in the unload event of those two forms.. but the strack trace indicates that it comes from the redirect statement.. so i guess that possibility is out.
I'm not that concern that the error is thrown, I'm just worried if the functionality will be interrupted. There is a lot of code in the Submit_Click method, then a lot of code in the Page_Load method of the page it goes too - maybe thats why it doesn't finish smoothly? So far all the functionality executes properly and completely, even when the error is thrown, but I'd still like to know why its doing it.
I did alot of searching, and it seems this is normal behavior.. all the typical asp ending functions will throw an exception most of the time.. which has to be a design flaw on microsofts behalf..

the way to fix it, tells microsoft is using the overload .Redirect("url", False)
and instead of response.end (for future reference) use HttpContext.Current.ApplicationInstance.CompleteRequest

i found this info at http://support.microsoft.com/default.aspx?scid=KB;EN-US;312629