logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-23-2007, 11:17 AM   #1
odellp
 
Join Date: Sep 2007
Posts: 3
Default ASP Post Data Problem

Hi

I am using dreamweaver 9 with IIS as local server and Win XP Pro
I am trying to get started by creating a simple site with 2 pages test.aspx and receive.aspx.

Test.aspx has a simple form with textbox and submit button and I want to post the form data to another page receive.aspx which has a datagrid to display the results but when I click the submit button it just refreshes the test.aspx page.Looking at the code for firefox action =test.aspx where my original dreamweaver code says receive.aspx

Any help for a newbie appreciated

Mozilla Firefox code for test.aspx


Code:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><form name="form1" method="post" action="test.aspx" id="form1"><div><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEzMzE5MDUyNjFkZO4bMH+HPPVJGcRX1pIYGjyIssUf" /></div> <p> <input name="txtEnter" type="text" value="action" id="txtEnter" /></p> <p>&nbsp;</p> <p> <input type="submit" name="searchButton" value="search" id="searchButton" /></p> <p>&nbsp;</p> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwKkrYKeDALDhPyrCwKx1vaaCdRRLAeII42k69nPxxJy2+2rBaa3" /></div></form></body></html>
Dreamweaver code
Code for test.aspx

HTML Code:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="receive.aspx" method="post" name="form1" id="form1" runat="server">
<p>
<asp:TextBox ID="txtEnter" Text="action" TextMode="SingleLine" runat="server" />
</p>
<p>&nbsp;</p>
<p>
<asp:Button ID="searchButton" runat="server" Text="search" />
</p>
<p>&nbsp;</p>
</form>
</body>
</html>
code for receive.aspx

Code:
 
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:DataSet 
id="DataSet2"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_test") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_test") %>'
CommandText='<%# "SELECT * FROM info WHERE genre = ?" %>'
Debug="true" PageSize="10"
>
<Parameters>
<Parameter Name="@genre" Value='<%# IIf((Request.QueryString("genre") <> Nothing), Request.QueryString("genre"), "") %>' Type="WChar" />
</Parameters>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="false" />
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form method="get" name="myForm" id="myForm" runat="server">
<asp:DataGrid id="DataGrid1" 
runat="server" 
AllowSorting="False" 
AutoGenerateColumns="false" 
CellPadding="3" 
CellSpacing="0" 
ShowFooter="false" 
ShowHeader="true" 
DataSource="<%# DataSet2.DefaultView %>" 
PagerStyle-Mode="NextPrev" 
AllowPaging="true" 
AllowCustomPaging="true" 
PageSize="<%# DataSet2.PageSize %>" 
VirtualItemCount="<%# DataSet2.RecordCount %>" 
OnPageIndexChanged="DataSet2.OnDataGridPageIndexChanged" 
>
<HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" /> 
<ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" /> 
<AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" /> 
<FooterStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" /> 
<PagerStyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" /> 
<Columns>
<asp:BoundColumn DataField="ID" 
HeaderText="ID" 
ReadOnly="true" 
Visible="True"/> 
<asp:BoundColumn DataField="filmname" 
HeaderText="filmname" 
ReadOnly="true" 
Visible="True"/> 
<asp:BoundColumn DataField="genre" 
HeaderText="genre" 
ReadOnly="true" 
Visible="True"/> 
<asp:BoundColumn DataField="imdblink" 
HeaderText="imdblink" 
ReadOnly="true" 
Visible="True"/> 
<asp:BoundColumn DataField="description" 
HeaderText="description" 
ReadOnly="true" 
Visible="True"/> 
<asp:BoundColumn DataField="timelength" 
HeaderText="timelength" 
ReadOnly="true" 
Visible="True"/> 
</Columns>
</asp:DataGrid>
</form>
</body>
</html>
odellp is offline   Reply With Quote
Old 09-25-2007, 03:35 PM   #2
odellp
 
Join Date: Sep 2007
Posts: 3
Default

Well I used a spry form to post data but displayed results with asp grid and it works
Still dont know why asp doesnt work
odellp is offline   Reply With Quote
Old 09-25-2007, 03:49 PM   #3
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

odell, asp people are few and far between here. Stick around for a while, I'd love to have some more ASP people here.
domedia is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:20 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com