Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Takashi Koyama 15 posts 56 karma points
    Feb 10, 2015 @ 23:23
    Takashi Koyama
    0

    Umbraco prevents aspx page from running

    I created a jQuery html page which calls an aspx page to verify a credential.  It works perfectly on my ohter non umbraco site.  However, the same files does not run under the umbraco site.  It seems something in web.config may prevent any aspx page from running.  How do I allow the site to run an aspx page at the root?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 11, 2015 @ 05:26
    Jan Skovgaard
    2

    Hi Takashi and welcome to our :)

    That's because Umbraco is trying to resolve your custom .aspx site to a page in the CMS unless you tell it not to do so.

    In the web.config you need to add the path to your custom .aspx file in the Umbraco specific key "umbracoReservedUrls"

    <add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx" />
    

    So you need to add the path to your file in this list as well like

    <add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx, ~/the/path/to/your/file.aspx" />
    

    Hope this makes sense.

    /Jan

  • Takashi Koyama 15 posts 56 karma points
    Feb 11, 2015 @ 18:43
    Takashi Koyama
    0

    It worked!!  Thanks Jan!!  It was a challenge for me to incorporate Umbraco and jquery, ajax.  As a developer, it is great to have the freedom to put my own stuff.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 11, 2015 @ 21:49
    Jan Skovgaard
    0

    Hi Takashi

    That's really good to hear :) - Remember to mark the topic as solved so others can go straight to the solution if they come across the same issue.

    Yes it's indeed nice to be able to incorporate stuff outside of an Umbraco context as well. It gives you some nice flexibility and freedom indeed.

    Happy umbracoing :)

    /Jan

  • Takashi Koyama 15 posts 56 karma points
    Feb 17, 2015 @ 23:44
    Takashi Koyama
    0

    This particular issue is fixed.  But I have another issue.  I've created another aspx and added it's path in <add key="umbracoReservedUrls".  This aspx page connects to a SQL server and its connection string is hard coded so it is complied into a dll.

     

    Umbraco prevents this from running.  it works on my machine and not part of umbraco.   Do I need to set another tag like in  <add key="umbracoReservedUrls"?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 17, 2015 @ 23:52
    Jan Skovgaard
    0

    Hi Takashi

    Yes if it's another custom .aspx page you have created then it should be added in the umbracoReserverUrls key tag. You should not create a new tag but simply just add the new path to the value attribute splitting the values with a comma, like in the example above. There can only be one umbracoReservedUrls key tag in the web.config.

    Hope this makes sense.

    /Jan

  • Takashi Koyama 15 posts 56 karma points
    Feb 17, 2015 @ 23:55
    Takashi Koyama
    0

    Hi, Jan.

    That's exactlyI did.  I just added the path in the tag.  Only difference is this page connects to a SQL server.  CMS is using umbraco.sdf.  Does anything else block this page from connecting to a sql server?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 18, 2015 @ 00:08
    Jan Skovgaard
    0

    Hi Takashi

    That should not make a difference I think...but now I'm becoming a bit uncertain.

    Does it work if you try doing the following

    1: Place the .aspx file that connects to a MSSQL DB on the desktop or another temporary place 2: Create an empty .aspx file with the same name in the Umbraco project where the original file was placed and give it the same name 3: Can you access this file or does Umbraco still intercept it?

    /Jan

  • Takashi Koyama 15 posts 56 karma points
    Feb 18, 2015 @ 18:57
    Takashi Koyama
    0

    Hi, Jan.

    I tried to connect to MSSQL DB on the desktop but it did not go well.  So what I did was to copy all the files into another site on the same server.

    The connection string was hard coded on purpose to eliminate another complication. The aspx page had no problem connecting to a SQL server.

    When I called the page in umbraco 

    <umbraco site>/custom/SurveyHandle.aspx?rdQ1=1&rdQ2=0&txtFirstName=Panda

    it gave me the popular error like the following. (Onlly explanation I can think of umbraco is blocking the sql server connection since non-umbraco site had not issue running my aspx page.)

    Server Error in '/' Application.


    Runtime Error

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

  • Takashi Koyama 15 posts 56 karma points
    Feb 18, 2015 @ 22:50
    Takashi Koyama
    0

    I placed a try catch block around the connection object as follows.

    try{

        myConnection.Open();

    }

    catch (Exception tex){

        Response.Write("Connection could not open. " + tex.Message);

    }

     

    The error I got was Login failed for user "NT AUTHORITY\ANONYMOUS LOGON".

    The very same dll in the other site in the same server did not throw this exception.  I'm wondering whether Umbraco site's web.config cause this exception.

    The IIS setup is nearly identical for both sites.  

     

  • Takashi Koyama 15 posts 56 karma points
    Feb 19, 2015 @ 15:46
    Takashi Koyama
    0

    I figured out how to solve this!!  Thank you everyone for your help and thoughts!  By talking to people made me delve into deeper investigatoin and solved this issue.  Now I get a freedom to connect to database of my choice!!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 19, 2015 @ 15:47
    Jan Skovgaard
    0

    Hi Takashi

    Happy to hear you managed to get it solved - Do you mind sharing how you managed to think of a solution? Others might benefit as well :)

    /Jan

  • Takashi Koyama 15 posts 56 karma points
    Feb 19, 2015 @ 16:18
    Takashi Koyama
    1

    Hi, Jan.

    Thanks for your help and patience.

    The solution involves in our company specific database connection using impersonate tag so I won't be able to put down everything but I can share some.

    1) Umbraco does not block SQL server connection!!  (Good news!)

    2) I put all my aspx and web.config in the same folder.  So there is a web.config for umbraco CMS and web.config for my own aspx pages.  This way, I can concentrate on my aspx setup.

    3) Put an enviroment specific database connection inclluding impersonate tag in the web config for my aspx.

    With the above setup, I can call my aspx from any Umbraco page using Ajax and put the result in database of my choice!!!

    The important step is to put bunch of try catch block in the code to get a specific error so that I can pinpoint "WHERE" to look for the issue.

     

     

  • Ando 1 post 21 karma points
    Mar 13, 2015 @ 02:07
    Ando
    0

    Sorry just saw the solution in the previous reply..

Please Sign in or register to post replies

Write your reply to:

Draft