Jump to content

aspx - somebody got it to work here?


Recommended Posts

im trying to get this to work, but have no idea why it dont work here...

 

<%@ page language="VB" %>

 

<script runat="server">

 

Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Label1.Text = "Hello " & TextBox1.Text

End Sub

</script>

 

<html>

<head>

<title>ASP.NET Inline Pages</title>

</head>

<body>

<form id="Form1" runat="server">

<h1>Welcome to ASP.NET 2.0!</h1>

<b>Enter Your Name:</b>

<asp:TextBox ID="TextBox1" Runat="server"/>

<asp:Button ID="Button1" Text="Click Me" OnClick="Button1_Click" Runat="server"/>

<br />

<br />

<asp:Label ID="Label1" Text="Hello" Runat="server" />

</form>

</body>

</html>

 

Link to comment
Share on other sites

What error are you getting?

Server Error in '/' Application

 

--------------------------------------------------------------------------------

 

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".

 

 

<!-- Web.Config Configuration File -->

 

<configuration>

<system.web>

 

<customErrors mode="Off"/>

</system.web>

</configuration>

 

 

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

 

<!-- Web.Config Configuration File -->

 

<configuration>

<system.web>

<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>

 

</system.web>

</configuration>

 

 

but dont know how where, or how to change the web.config

Link to comment
Share on other sites

Create a web.config file in the same directory your .aspx file is.

 

Thanks, now i got the error.. but what to so about it is the big question:

 

Process has not been started.

Description: HTTP 500. Error processing request.

 

Stack Trace:

 

System.InvalidOperationException: Process has not been started.

at System.Diagnostics.Process.get_ExitCode () [0x00000]

at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ExitCode ()

at Microsoft.VisualBasic.VBCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000]

at Microsoft.VisualBasic.VBCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000]

at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000]

at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.String virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00000]

at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.String virtualPath) [0x00000]

at System.Web.Compilation.BuildManager.BuildAssembly (System.String virtualPath) [0x00000]

at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000]

at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.String virtualPath, System.Type requiredBaseType) [0x00000]

at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000]

at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000]

at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000]

at System.Web.HttpApplication+<>c__CompilerGenerated2.MoveNext () [0x00000]

 

 

here is my web.config:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<system.web>

<compilation defaultLanguage="c#" debug="true"/>

<customErrors mode="Off" />

<authentication mode="Windows" />

<authorization>

<allow users="*" />

</authorization>

<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />

</system.web>

</configuration>

Link to comment
Share on other sites

Does it work now?

 

Yep, After i converted the code to use C# instead of VB it works...

 

Here is the examples:

 

 

default.aspx:

<%@ page language="C#" %>

 

<script runat="server">

void Button1_Click(object sender, System.EventArgs e)

{

Label1.Text = "Hello " + TextBox1.Text;

}

</script>

 

<html>

<head>

<title>ASP.NET Inline Pages</title>

</head>

<body>

<form id="Form1" runat="server">

<h1>Welcome to ASP.NET 2.0!</h1>

<b>Enter Your Name:</b>

<asp:TextBox ID="TextBox1" Runat="server"/>

<asp:Button ID="Button1" Text="Click Me" OnClick="Button1_Click" Runat="server"/>

<br />

<br />

<asp:Label ID="Label1" Text="Hello" Runat="server" />

</form>

</body>

</html>

 

 

web.config:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<system.web>

<compilation defaultLanguage="c#" debug="true"/>

<customErrors mode="Off" />

<authentication mode="Windows" />

<authorization>

<allow users="*" />

</authorization>

<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />

</system.web>

</configuration>

 

 

Put both files in the same directory.

 

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...