.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 30th, 2003, 07:28 AM
cbonsall cbonsall is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: South West UK
Posts: 7 cbonsall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to cbonsall
View State Problems.

I'm following the very simple samples in "ASP.NET UNLEASHED".

And I have written the following code (in fact pasted direct from their site.

<form runat="Server">
<b>Username:</b>
<br><input id="username" type="text" size="30" runat="Server">
<p>
<b>Comments:</b>
<br><textarea id="comments" cols=60 rows=10 runat="Server"></textarea>
<p>
<input type="submit" value="Add Comment" runat="Server">
</form>
</body>
</html>


Accordign to the book ASP.NET uses "view state" to rememeber what was in the field previously. The book says that this form should therefore keep the data in the fields after I submit but when I try it it deletes the content.

Any ideas why? Is there some setting within IIS that I need to change?

help me please!!!!!!!

I wish I could use PHP and Apache :-(

Reply With Quote
  #2  
Old September 30th, 2003, 03:55 PM
emladris emladris is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: SC
Posts: 26 emladris User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb Believe me, when you finally get it, you'll love ASP.NET.

You are correct that the viewstate is default. What is in your codebehind page?

I pasted your code directly into a NEW webform, and my viewstate was there. Here is the entire page code, look at it compared to yours:


========================================
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="AcroWebInterface.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<b>Username:</b>
<br>
<input id="username" type="text" size="30" runat="Server" NAME="username">
<p>
<b>Comments:</b>
<br>
<textarea id="comments" cols="60" rows="10" runat="Server" NAME="comments"></textarea>
<p>
<input type="submit" value="Add Comment" runat="Server" ID="Submit1" NAME="Submit1">

</form>
</P>
</body>
</HTML>
========================================

Hope it helps!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > View State Problems.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT