'System.Web.HttpRequest' does not contain a definition for 'form'

Hello all. .NET 2.0 newbie here....

What I'm trying to do is learn how to use the LoadVars() in actionscript. Here is the .NET / C#/ html code

 

1     <form id="form1" runat="server">
2        <div>
3        <%
4        if (Request.form("userName") == "Cameron")
5            {
6                Response.Write("&aspvar=it is You!");
7            }
8            else
9            {
10               Response.Write("&aspvar=you are not Cameron&");
11           }
12       
13        %>
14       </div>
15       </form>
 

When I run this I get

get a compilation error:

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: CS0117: 'System.Web.HttpRequest' does not contain a definition for 'form'

Any help would be greatly appreciated. Thanks,

Cameron

-1
cellis3306
6/9/2007 10:45:54 PM
asp.net.getting-started 91979 articles. 2 followers. Follow

2 Replies
1045 Views

Similar Articles

[PageSpeed] 20

C# is a case-sensitive language.

the Form property of the Request object uses an uppercase "F"

Request.Form

 


Mike Banavige
~~~~~~~~~~~~

Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
1
mbanavige
6/9/2007 10:49:20 PM

Hello,

ASP.NET newbie here. The following is part of some code I am trying to get to work with actionscript LoadVars() events. When I run it, I get an error

 

1    <form id="form1" runat="server">
2        <div>
3        <%
4        if (Request.Form("userName") == "Cameron")
5            {
6                Response.Write("&aspvar=it is You!");
7            }
8            else
9            {
10               Response.Write("&aspvar=you are not Cameron&");
11           }
12       
13        %>
14       </div>
15       </form>

 The error I am recieving is:

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: CS0118: 'System.Web.HttpRequest.Form' is a 'property' but is used like a 'method'

Please Help! Thanks :)

1
cellis3306
6/9/2007 11:29:21 PM
Reply:

Similar Artilces:

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

'System.Windows.Forms.DataGridView' does not contain a definition for 'databind' and no extension method 'databind' accepting a first argument of type 'System.Windows.Forms.DataGridView' could be foun
 Error    1    'System.Windows.Forms.DataGridView' does not contain a definition for 'databind' and no extension method 'databind' accepting a first argument of type 'System.Windows.Forms.DataGridView' could be found (are you missing a using directive or an assembly reference?) how to solve this Are you using a web applictaion or windows application. If web aplictaion then you should not use 'System.Windows.Forms.DataGridView'  Try using system.web.ui.control.datagridVikram www.vikramlakhotia.comPlease ma...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

'System.Web.UI.Control' does not contain a definition for 'DataItem'
Hi, I am recieving this error: 'System.Web.UI.Control' does not contain a definition for 'DataItem' What iam trying to do is when a user clicks the hyperlink column in the datagrid then the ID of that user is send to another page and I need to run the Query or something and bind the Label on the page 2 with the name of the Person. So I am using the HTML view and writing something like this : '<%# DataBinder.Eval(Container.DataItem,"Name") %> ' here is my code behind file so how can i bind the Name of the person with the label: private void Page_Lo...

'System.Web.Mvc.HtmlHelper' does not contain a definition for 'GridView'
Hi,Using this article http://weblogs.asp.net/stephenwalther/archive/2008/06/24/asp-net-mvc-tip-8-create-an-asp-net-mvc-gridview-helper-method.aspxi have created gridview based on that but, the error follows  Compiler Error Message: CS1928: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'GridView' and the best extension method overload 'VMLBlogsite.Helpers.GridExtensions.GridView(System.Web.Mvc.HtmlHelper, System.Data.Linq.ITable)' has some invalid arguments Source Error: Line 8: Simple Grid Line 9: Line 10: <%= Html.GridV...

'System.Web.UI.Control' does not contain a definition for 'DataItem'
Hi, I am getting this error does anyone knows how to solve this :DHighOnCodingWanna get high! Show us the code that produces this error. Other than the exactness of the error, which explains what is exactly happening, we can't see why this is happening without seeing your code.David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(Please 'Mark as Answer' when i...

'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Calendar'
Hi, Please anybody tell me what this error. I use asp.net MVC Beta. This error showing in gridview too how to rectify it?Compiler Error Message: CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Calendar' and no extension method 'Calendar' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) Source Error: Line 8: Line 9: Mvc Calendar 1: Simplest Calendar Line 10: <%= Html.Calendar() %> Line 11: Line 12:   &nbs...

Cannot implicitly convert type 'System.Xml.XmlNode' to 'XmlNode' and 'XmlNode' does not contain a definition for 'AppendChild'
Hi,      XmlNode t = xmlDoc.SelectSingleNode("/NewDataSet/Table1/Template");//Cannot implicitly convert type 'System.Xml.XmlNode' to 'XmlNode'//        XmlText textNode1 = xmlDoc.CreateTextNode("hello");                       XmlElement ChildofTemplate = xmlDoc.CreateElement("ChildTemplate");//'XmlNode' does not contain a definition for 'AppendChild'// ...

Getting 'System.Web.UI.Control' does not contain a definition for 'DataItem' error on controls when placed inside an update panel which is in a template.
Using the June CTP, I;ve got an updatepanel inside the itemtemplate of a datalist which is now suppopsed to be supported (it works). I also have some asp controls (imagebutton, label) which get their values dynamically (DataBinder.Eval(Container.DataItem, "fieldname").ToString(). This would work fine before putting the updatepanel in the datalist itemtemplate, I now get the error in the title when building ('System.Web.UI.Control' does not contain a definition for 'DataItem') for each control... How can I dynamically assign the values to the controls in the datalist when also using upd...

'System.Web.UI.WebControls.Panel' does not contain a definition for 'drpData'
Hi i have the following problem: Compiler Error Message: CS0117: 'System.Web.UI.WebControls.Panel' does not contain a definition for 'drpData' Source Error: Line 59: strvBilled = filepath.ToString(); Line 60: strvPris = tbvPris.Text; Line 61: strvKategori = tbvKategori.drpData.SelectedItem.Value.ToString(); Line 62: strSQL = "INSERT INTO varelist (vNummer, vNavn, vBeskriv, vBilled, vPris, vKategori) Values ("; Line 63: strSQL += strvNummer + ", '"; It should come from this list: <asp:panel ID="tbvKategori" r...

CS0117: 'System.Web.Security.MembershipUser' does not contain a definition for 'UserName'
Hi, I export my dataBase1 on others dataBase2. But , now, I have this errors.   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: CS0117: 'System.Web.Security.MembershipUser' does not contain a definition for 'UserName'Source Error: Line 77: { Line 78: MembershipUser memberUser = Membership.GetUser(); Line 79: if (memberUser.UserName != null && ...

'System.Web.UI.WebControls.Label' does not contain a definition for 'Invoke'
I am making an asyncronous call to a web service. When the callback happens and my delegate is called, I want to set a text value on a label on my page. In order to do this I need to use Label1.Invoke -- However, when I compile this I get an error'System.Web.UI.WebControls.Label' does not contain a definition for 'Invoke'I thought all controls should have an Invoke method on it.. I don't understand why I get this error? Any one experience the same thing or have any clue as to what is going on? // we must invoke to get back to the UI thread...this.Label1.Invoke(new La...

'System.Web.UI.WebControls.TextBox' does not contain a definition for 'InnerHtml' and ...
Hi,I have the problems (the following is one of those) with the codes below.Error 4 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'InnerHtml' and no extension method 'InnerHtml' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?)  Here is the markup file of 'Start.aspx' <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="Newsite._Default" %...

Error 39 'System.Data.DataRow' does not contain a definition for 'Item'
for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) { categoryID = ds.Tables[0].Rows[i].Item["categoryID"]; name = ds.Tables[0].Rows[i].Item["name"]; string catID = Convert.ToString(categoryID); ///Change made by me ddlCategory.Items.Add(new ListItem(name, catID)); qry = "Select count(categoryID) from categories where active = 'True' AND parentID=" + categoryID + ""; countCategories = objDB.getScalar(qry);       i get this errorIf the going seems easy, You are going DownHill... I've got the solution what you have to ...

Web resources about - 'System.Web.HttpRequest' does not contain a definition for 'form' - asp.net.getting-started

Resources last updated: 1/17/2016 3:27:12 AM