Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi, i´m trying to do a form as i did in html, and address the method post to an ASP.NET page, to work with the data got in the form. If i try to do Request.Form(variable) as i did in ASP 3 i´ve got an error. Could anybody tell me how can i do it??

Thanks.

Adolfo.
Posted

Here it is the .aspx code of the form(for example)

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="Laboratorios.WebForm1" enableViewState="True" enableViewStateMac="False"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<HTML>

<HEAD>

<title>WebForm1</title>

<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">

<meta content="C#" name="CODE_LANGUAGE">

<meta content="JavaScript" name="vs_defaultClientScript">

<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">

</HEAD>

<body MS_POSITIONING="GridLayout">

................................

<form method="POST" action="Laboratorios.aspx">

<dd>

<input type="radio" name="Tipo mensaje" value="Queja">Queja <input type="radio" name="Tipo mensaje" value="Problema">Problema

<input type="radio" checked name="Tipo mensaje" value="Sugerencia">Sugerencia <input type="radio" name="Tipo mensaje" value="Elogio">Elogio

..............

<input type="submit" value="Enviar comentarios" style="Z-INDEX: 102; LEFT: 24px; POSITION: absolute; TOP: 128px"> 

<td></td>

<input type="reset" value="Borrar formulario" style="Z-INDEX: 103; LEFT: 240px; POSITION: absolute; TOP: 128px">

</form>

</form>

</DD>

</body>

</HTML>

 

and in the .aspx.cs code of an asp.net page i want to do something like that

if(Request.Form(Tipo mensaje)==Sugerencia)

.................

Adolfo.
Posted

Forgot to quote the item name and what you are comparing against.... all "Request.Form" items are strings, so:

 

if(Request.Form('Tipo mensaje')=='Sugerencia')

 

should work

If you make it idiot proof, they'll build a better idiot :-)
Posted

I don´t know if i´m doing something wrong, but it still doesn´t work. When i write that code there´s an error in that line, translating from spanish to english it would say something like that:

System.Web.HttpRequest.Form show property, when a method was expected

Thanks in advance for any help.

Adolfo.

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