Showing posts with label stumped. Show all posts
Showing posts with label stumped. Show all posts

Saturday, March 24, 2012

Strange Error in ASP.NET C# Application

This one has me stumped. I'm looking at support files for a C# textbook,
including three ASP.NET applications that use Access databases. I create
virtual directories for the applications in IIS (running Win XP SP1 and Win
2000 SP4 dual boot - error occurs under either OS), then load the app into
the VS.NET 2003 IDE. When I attempt to run the application, I get the
following error in my browser, instead of the startup page:

Server Error in '/RoadSignReview' Application.

Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: CS1595: 'RoadSignReview.RoadSigns' is defined in
multiple places; using definition from
'c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempor ary ASP.NET
Files\roadsignreview\cebae5e1\8b8437d2\assembly\dl 2\da6e1f98\00031afb_ea55c3
01\RoadSignReviewCS.DLL'

Source Error:

Line 27:
Line 28:
[System.Runtime.CompilerServices.CompilerGlobalScop eAttribute()]
Line 29: public class RoadSigns_aspx : RoadSignReview.RoadSigns,
System.Web.SessionState.IRequiresSessionState {
Line 30:
Line 31:

Source File: c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\roadsignreview\cebae5e1\8b8437d2\ss6l2cvv.0. cs Line: 29

The above does not, of course, refer to anything the developer created.
And, just to make it even more fun, if I create this application myself on
the same PC (using the source code in the book), it runs OK.
Remember, this same phenomenon in *three different* apps.

If anybody has seen this and/or has any idea how to deal with it, I'd very
much appreciate some feedback.

--
************************************************** ********************
** All opinions are mine alone.Do not attribute elsewhere!
************************************************** ********************
** Peter van der Goes, Professor, Computers & Information Technology
** Rose State College
*********************** Contact ************************************
** Office e-mail: pvan@dotnet.itags.org.rose.edu
** Home e-mail: p_vandergoes@dotnet.itags.org.cox.net
** Web Page: http://www.rose.edu/Faculty/pvan/index.htm
************************************************** ********************"codewriter" <code_writer_2003@.yahoo.com> wrote in message
news:hcfXa.319$pq5.100276@.news20.bellglobal.com...
> This question has been asked hundreds of times before, as far as I
remember.
> The couse is either conflicting assemblies for the same source or code
> behind tags are screwed up.
> Delete your dlls and recompile.
I appreciate the information. Works like a charm.
Somehow, I was unable to find this simple fix on my own, but I won't forget
it.
Thanks very much!

Tuesday, March 13, 2012

Strange page redirection using enter key

This is a very strange one and has me stumped.

My login page is redirecting the user to a new virtual directory index.aspx page when the enter key is hit.

Clicking the submit button works just fine, and have tested it commenting out the code and
hitting the enter key and it still redirects.

I have tried with no luck to use some code I have before that works just fine on another page, with no redirection, that page is in the same folder with the same user controls.

This didn't do the trick in the page load event to use the enter key for the submit click...


Page.RegisterHiddenField("__EVENTTARGET", cmdSubmit.ClientID)

Why is this one page redirecting to another page?
I have checked the code over so many times and found nothing.

I need some suggestions on what to look for or other ways to test this to find out why.
I never had to do a trace like this, I came across it a few times where printing out the stack trace is possible. Anyone have a link to do this?

Thanks all,

ZathMy guess is that the "default" button on this page is not the one you expect.

Presumably you're talking aboutthis login.aspx page? And pressing Enter moves the user off toztrader/index.aspx?

If so,surely one of your event handlers is doing a Response.Redirect to this page??
Yes, you are correct on that is the login page and that is the page it's redirecting to. You must have visited my site... LOL

But you did get me thinking a bit more and I removed the ZciFi Trader button with code in it, replaced it with a hyperlink, then moved the needed code elsewhere and that did the trick.

But still, why is the enter key activating that button which is on a user control?
They are even different names.

Very strange indeed.

Thanks,

Zath
> why is the enter key activating that button which is on a user control?

The fact that it's in a User Control makes no difference ... by the time the page gets to the user, it's all a single HTML page.

If you look at the HTML of your page (View > Source), you'll see a number of <input type="submit" ...> tags. Whichever occurs first in the HTML will be considered the "defaut" button. So clicking Enter while in any textbox of that form, not matter how far it is located from that first <input type="submit"> button, will trigger that submit button.

Very confusing if you don't know that this is how HTML forms work. (And I don't think this behaviour is consistent across all browsers.)
Yes, I see what you mean. Good to know.

I just added the new feature to my site this weekend, which I try to do on the weekends beacuse no matter how much you test, there's always something you missed.

Thanks again,

Zath