Web Hosting Forum | Lunarpages

Author Topic: My First .NET Website: How-to Guide  (Read 80724 times)

Offline sarahjayne5792

  • Space Explorer
  • ***
  • Posts: 6
Re: My First .NET Website: How-to Guide
« Reply #15 on: April 23, 2008, 03:32:26 PM »
I'm not sure if anyone is checking this anymore who has knowledge of this stuff, but any help would be awesome. When I run my query this is what says.


Server Error in '/mssql' Application.
A potentially dangerous Request.Form value was detected from the client (sqlstmt="...NG = OFF, ONLINE = OFF, ALLOW_...").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (sqlstmt="...NG = OFF, ONLINE = OFF, ALLOW_...").

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (sqlstmt="...NG = OFF, ONLINE = OFF, ALLOW_...").]
   System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +240
   System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +99
   System.Web.HttpRequest.get_Form() +113
   System.Web.UI.Page.GetCollectionBasedOnMethod() +70
   System.Web.UI.Page.DeterminePostBackMode() +128
   System.Web.UI.Page.ProcessRequestMain() +2112
   System.Web.UI.Page.ProcessRequest() +218
   System.Web.UI.Page.ProcessRequest(HttpContext context) +18
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87


i have no clue what this mean....it might refer to the fact that i do have a login page in order for people to access the site, meaning they must create a profile before they are able to view the pages.


i don't know..any help would be great.

Offline hw15

  • Spacescooter Operator
  • *****
  • Posts: 36
    • Internet ArchiTECH
Re: My First .NET Website: How-to Guide
« Reply #16 on: April 24, 2008, 06:47:28 AM »
Hello, are you using the template provided by Microsoft for a starter .NET website, or did you build the website yourself?
Web development and consulting by Internet ArchiTECH.

Offline sarahjayne5792

  • Space Explorer
  • ***
  • Posts: 6
Re: My First .NET Website: How-to Guide
« Reply #17 on: April 24, 2008, 05:15:58 PM »
thank u so much for responding! as the story goes, i took an online aspx tutorial class and we developed this site, not the template but my instructors template ...however the instructor never actually went through with how to publish the site. everything works fine on my own computer i just don't know how to publish it, i only know how to publish regular htm/html files. my issue yesterday actually stemmed from something lunarpages had to fix with me not being able to connect through little admin tool so i was trying to use a different service lunar pages offered, anyways long story,short lunarpages fixed that problem and  i am now doing everything exactly as your message has posted (very great message by the way) and this is the error i now get. do you think this is something lunarpages will help me with or is this still out of their realm because i have no idea what this error means. If you can respond that great! i appreciate it so much, this is actually part of my final masters project and its due monday! i've been trying for over a month to get my site published! i'm supposed to graduate may 10th.

Offending URL: http://lesuth.lunarpages.com/mylittleadmin3/tools/query.aspx

Source: System.Data

Message: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.

Stack trace: at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at mla_gui.NewQuery.btnSubmit_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Target site: System.Data.SqlClient.SqlInternalConnection GetOpenConnection(System.String)

Offline hw15

  • Spacescooter Operator
  • *****
  • Posts: 36
    • Internet ArchiTECH
Re: My First .NET Website: How-to Guide
« Reply #18 on: April 25, 2008, 08:30:03 AM »
Hello, thank you for the details. I am not sure what that error means either. You are correct, we need to determine if it is a problem with Lunarpages or with your instructor's .NET website template. I wish I could be of more help. One thing you could try is using the Microsoft .NET starter template. Follow the instructions I have provided to publish the website. It should only take 30 minutes or so. If you successfully publish the Microsoft website, then you will know that Lunarpages is working fine and there may be a problem with your instructor's template. If not, then you may get another error message. Please post that error message and I will take a look. It could give us some clues. I wish I could give you more help to figure out how to fix Lunarpages or your instructor's .NET website template. Good luck to you on your master's project.
Web development and consulting by Internet ArchiTECH.

Offline sarahjayne5792

  • Space Explorer
  • ***
  • Posts: 6
Re: My First .NET Website: How-to Guide
« Reply #19 on: April 25, 2008, 06:01:15 PM »
thank u!

did exactly what you said with the directions you provided still go this

Offending URL: http://lesuth.lunarpages.com/mylittleadmin3/tools/query.aspx

Source: System.Data

Message: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.

Stack trace: at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at mla_gui.NewQuery.btnSubmit_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Target site: System.Data.SqlClient.SqlInternalConnection GetOpenConnection(System.String)



I wonder what connection it is referring to that is closed....lunarpages says they will charge me 75 dollars for any help...but i don't feel like this one may be my fault....

Offline hw15

  • Spacescooter Operator
  • *****
  • Posts: 36
    • Internet ArchiTECH
Re: My First .NET Website: How-to Guide
« Reply #20 on: April 25, 2008, 10:04:20 PM »
Hi, what step were you on when you received this error?
Web development and consulting by Internet ArchiTECH.

Offline sarahjayne5792

  • Space Explorer
  • ***
  • Posts: 6
Re: My First .NET Website: How-to Guide
« Reply #21 on: April 26, 2008, 07:41:12 AM »
The step where you copy and paste the text into the new query box and you hit submit. That is the error that appears on the page. It did it for both .sql files I tried to upload.




Offline kilativ

  • Newbie
  • *
  • Posts: 2
Re: My First .NET Website: How-to Guide
« Reply #22 on: September 02, 2008, 01:01:36 PM »
Works great in a virtual directory! How do i deploy my site to the root of my domain? Doesn't seem to pick up web.config.

Offline kilativ

  • Newbie
  • *
  • Posts: 2
Re: My First .NET Website: How-to Guide
« Reply #23 on: September 02, 2008, 01:20:58 PM »
Actually ignore me. It was a bug in my code

Offline vks87

  • Intergalactic Cowboy
  • *****
  • Posts: 61
Re: My First .NET Website: How-to Guide
« Reply #24 on: March 03, 2009, 11:53:11 PM »
Quite interesting...Take a one more thumbs up from myself..

Offline vks87

  • Intergalactic Cowboy
  • *****
  • Posts: 61
Re: My First .NET Website: How-to Guide
« Reply #25 on: March 18, 2009, 03:06:05 AM »
Its great man..You did a very hard work on it..so good job man..
I appreciate your work..and thanks for sharing..

Offline calberti

  • Newbie
  • *
  • Posts: 5
Re: My First .NET Website: How-to Guide
« Reply #26 on: April 27, 2009, 06:33:41 AM »
Hey,
thanks for the tutorial!
But how can I set the ASP.NET web application to run in the httpdocs folder so that I can access the site by simply going to http://www.mysite.com without any subdirectory?
Thanks,
Claudio

Offline jasonstores

  • Trekkie
  • **
  • Posts: 15
    • Engine Optimization Software
Re: My First .NET Website: How-to Guide
« Reply #27 on: November 04, 2009, 09:35:12 AM »
Wish i found that a mth ago  :thumb:

Offline Comet Software

  • Spacescooter Operator
  • *****
  • Posts: 40
Re: My First .NET Website: How-to Guide
« Reply #28 on: March 25, 2010, 01:09:52 PM »
Seems like this is the only/best thread for getting an ASP.NET site initially started on Lunarpages, so, I will post here.  Otherwise, please redirect me to the best thread.

Instead of using the publishing tools listed above, I am using Visual Studio 2008 and I will be continuing to use it for the foreseeable future.  This is my first ASP.NET application and I am stuck on a few basics where the solution(s) might also be helpful to others in this thread.  I seem to understand the concepts of the virtual directory, httpdocs, and, the various control files that ASP.NET wants to use.  As most folks just getting started on something, I get an error and I am lacking some basic information about some basic assumptions, so, I am not able to help myself yet.  Right now, when I try to run the aspx file, it is having problems finding files.  So, this post is focusing on the basic problem of folders, defaults, paths, etc.  So, here goes......

First, let's say that when I am developing an ASP.NET application in Visual Studio and I don't do anything to set paths and folder names.  Basically, I have the configuration files setting whatever the defaults are.  Then, I publish to my site on Lunarpages, either through a publishing mechanism or FTP.  What are the default paths and folders that Lunarpages has set up beyond the folders that I create?  Like, does it use a "bin" folder?  Are there default config files set up by Lunarpages that are used if I haven't created and published them?

For example, my problem right now is my aspx page is trying to access an XML file that I developed and published within the same folder as the aspx file.  Let's say that on my site that folder is "www.mysite.com/myaspsites/site1".  The error that I am getting is telling me that it is trying to find the XML file on "D:\Inetpub\vhosts\mysite.com\httpdocs\file2.xml".  Now, I know that path is the root of my site and that is it is trying to find "www.mysite.com/file2.xml".  So, my problem is that a default is set to the root folder, while I am wanting it to default to the current folder.  Basically, the defaults that are assumed in Visual Studios don't match the defaults in Lunarpages.  How is Lunarpages determining this default and how/where in Lunarpages  do I change that?

Next, after I get it figured out of where I set those folders, I want to move the XML file to a subfolder for security reasons.  Let's say that folder is "www.mysite.com/myaspsites/site1/secretstuff".  How I do that in Visual Studio is probably beyond the scope of this forum, so, I will focus on the Lunarpages aspect.  Is this the best scheme on Lunarpages for me to protect that file from hackers?  I understand that floating around is a magical "ASP.NET user" that I will use to process all the authentication and authorization stuff, so, that is probably a different issue.  Right now I am more worried about just getting headed in the right direction and maybe then it will be easier to help myself after that.

Thanks ahead of time for any help.

Offline Comet Software

  • Spacescooter Operator
  • *****
  • Posts: 40
Re: My First .NET Website: How-to Guide
« Reply #29 on: April 17, 2010, 06:53:47 PM »
I have a partial answer to my preceding post.

The XML file is accessed through an XMLDataSource.  By default the path in the DataFile property was set to this format:  ~/myfile.xml

Then, I found this web page called "Making Sense of ASP.NET Paths:  http://www.west-wind.com/weblog/posts/132081.aspx

It does a good job of explaining the various possibilities, including what the "~" really means ("root relative virtual path" - basically www.mysite.com/).  So, to test if I really understood, in Visual Studio I created a folder (secretstuff) within the project and moved my XML and XSLT files to the folder.  This matches my second situation above where I wanted to put my data files into a subfolder so that I can isolate them for security reasons.  Then, I changed the DataFile property in the XMLDataSource to:  secretstuff/myfile.xml    Of course, I had to change the TransformFile property to:  secretstuff/myfile.xslt

Then, on the site I moved myfile.xml and myfile.xslt to the folder:  www.mysite.com/myaspsites/site1/secretstuff

And, that works.  Basically the default location in Visual Studio 2008 for the XMLDataSource DataFile is the root of the web site, and, not the current folder (which was intuitive to me).  Maybe somebody knows how/where to change this default in my project/solution within Visual Studio.

So, what I have left from my preceding post is the question of whether or not it is the best security scheme to put my data files in a subfolder of the aspx files.  As it turns out, I am going to have a second implementation of the same aspx files in a sibling folder (site2 in addition to site1) with a separate set of data files.  Ideas/comments/suggestions? 

 

Share |