473,806 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with postback

Hi,

I visited this page to look at the postback tutorial:
http://quickstarts.asp.net/QuickStar...s/default.aspx

I take the code from this page for the postback tutorial and stick it into
new pages in my local website and they work. But when I try to implement the
code in some existing files -- it fails. The difference bewtween the files I
downloaded and the existing files in which I am trying to use the code
include:

1) my file uses a masterpage, a codebehind file, and an imageButton (as
opposed to a regular button)

2) my file is a form that writes to a database, uploads an image to a
directory, and then takes the user to a confirmation page where I am trying
to display the results of the form.

When i submit my form, the data is written to the db, the image is
uploaded -- but on the confirmation page, the label appears, but it does not
contain the text entered in the txtLastName text box on the form -- rather
it contains the default text in the label (Text="Label").

Here's the relevant code

confirmation page:
=============== ===============
<asp:Label ID="LabelX" runat="server" Text="Label" Font-Size="16pt"
ForeColor="#FF0 066" Font-Italic="True" /><span style="font-size: 16pt">
</span>
code behind
=============== ===============

Partial Class forms_artsFesti valUpload
Inherits System.Web.UI.P age
Protected WithEvents LabelX As System.Web.UI.W ebControls.Labe l

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s)
Handles Me.Load
Dim txtLastName As TextBox
txtLastName = Page.PreviousPa ge.FindControl( "txtLastNam e")
LabelX.Text = txtLastName.Tex t
End Sub
End Class
imagebutton on web form:
=============== ===============

<asp:ImageButto n ID="imageButton 1" runat="server"
ImageUrl="submi t-button.jpg" Width="100px"
PostBackUrl="ar tsfestivaluploa d.aspx" />

Can anyone tell me where I am goofed up?

thanks
Feb 9 '07 #1
0 995

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1638
by: john | last post by:
I have two different problems: 1. When the user has clicked on a button that is causing the browser to post back to the server, it could take a little while for the new page to show up. So in the mean time, I want to change the cursor to an hourglass and disable all of the controls on the form using javascript so the user can't do anything with any of the controls on the page. But when I disable certain controls (e.g. text boxes, radio...
2
1359
by: BluDog | last post by:
Hi I have a created a custom web control called ImageBrowser, extract is below: <Code> #Region "Properties" Public Property Images() As ImageCollection
1
4321
by: Steve Loper | last post by:
I am developing a control in ASP.NET 2.0 that is derived from GridView. This control handles paging on its own and thus renders custom paging buttons. It also add some other functionality to the GridView by overriding Render() and rendering other controls alongside the GridView’s HTML. When I click one of the pager buttons (of type ImageButton), I receive the following error: Invalid postback or callback argument. Event validation...
5
1542
by: WesIdell | last post by:
Hi All: I need some advice regarding a problem that I'm experiencing. I'm using a group of TextBox controls in the .aspx page and am using a function in the .cs code to perform some actions with the values. The problem is that when I try to retrieve the Text property, it is always equal to "" (an empty string) even though that a value is keyed in. I'm trying to do the same function with CheckBoxes and an array as well. Here's my code......
3
4917
by: dpomt | last post by:
I am facing some issues with the webforms DefaultButton functionality: #1 One text box ==> hitting enter works in IE but not in Firefox (1.5) #2 One text box and req. field validator ==> problem in IE #3 two text boxes ==> not even a postbak in Firefox. The three problems I have could be simply reproduced creating a new webform and pasting the code below in the codebehind file. TextBox bx1;
3
1862
by: moshi | last post by:
Hey, I'm working with asp.net 2.0. I make objects (like ddl, textbox...) disabled=true in client side. Then, when I get to the server in post action, these objects lose their value. For example: ddl comes back after postback with the first values in it's list - it doesn't keep the new value that the user chooses, and textbox - still remains it's last value, like the user didn't alter it. What I'm trying to say is that making object on...
1
1375
by: Jason | last post by:
I have a webpage that I've wrapped in an Atlas UpdatePanel. This page contains four textboxes, each with AutoPostBack set to true. The problem comes when someone edits the first box and tabs to the second box. They have enough time to make a quick edit to the second box before the postback completes and then the value in the second textbox is reset to the original value. Is there anything I can do about this? It's really causing...
3
3593
by: =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= | last post by:
Hi, I have an ASP.NET 2.0 application that allows content search. Search is included in all pages and a cross postback to the search results page is performed with the text inserted by the user. The search results also allows refining the search and a search button that performs a postback triggers the search. Many of the web pages in the web site have an OutputCache directive and the search results page does not. When I run the first...
0
1405
by: rn5a | last post by:
I have 2 ListBoxes which get populated with records from a database. The Form has a Button as well. Note that users can select multiple items in both the ListBoxes. When a user selects items from the 1st ListBox & clicks the Button, the selected items get deleted from the 1st ListBox & get appended to the 2nd ListBox at the very end. I also want that the items that have just got appended to the 2nd ListBox should also get selected. In...
3
1404
by: yovalk | last post by:
Hello, I have the following problem, I think it is rather simple, but hard to describe: I created a simple user control which contains a check box and an image - CheckBoxImage. Then I createa a control which contains and visually arranges CheckBoxImage controls in a table dynamically (it can contain diffrent numbers of ImageCheckBox)- CheckBoxImageContainer. The CheckBoxImage are added to the container dynamically. The problem is this:...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.