473,395 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

AutoPostBack erases Validator's error message

I have a (1) Textbox and (2) Dropdownlist

(1) is using RequiredFieldValidator
(2) is using AutoPostBack

Now, the problem is: when (2) is fired up and it reloads the page which
erases the error message displayed in (1). Any solutions or tips to solve
this problem?

C.P. [No MCSD]


Nov 19 '05 #1
1 1101
I think I got it working.. I am answering the question myself.. LOL...

public void Page_Load(object sender, System.EventArgs e)
if (IsPostBack)
Page.Validate();
}

then wrap the onchange code with this thing:

private void myDropdown_SelectedIndexChanged(object sender, System.EventArgs
e) {
if (Page.IsValid)
{
// code here..
}
}

"ChInKPoInt CumPeeWaRe [No MCSD]" <Ch*******************@yahoo.com> wrote in
message news:tI********************@rogers.com...
I have a (1) Textbox and (2) Dropdownlist

(1) is using RequiredFieldValidator
(2) is using AutoPostBack

Now, the problem is: when (2) is fired up and it reloads the page which
erases the error message displayed in (1). Any solutions or tips to solve
this problem?

C.P. [No MCSD]

Nov 19 '05 #2

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

Similar topics

1
by: Null | last post by:
Hello -- Is there a way to prevent the autopostback of a drop down list if there is a "default" item in the list -- example, a drop down list where the first item says "Select One" and the...
2
by: SLE | last post by:
A web user control exposes a RadioButtonList (with AutoPostBack = true) called "Question". This control also has an embedded RequiredFieldValidator control. 1. Main ASPX page is populated with...
0
by: dotnet beginner | last post by:
I have a textbox in a webform which is validated by a compare validator. Also the textbox has autopostback property set to true. When I work this way, the page immediately posts back, thus the...
1
by: Mad Scientist Jr | last post by:
I'm having this issue where textbox A on my form is recalculated every time textbox B, C, or D is changed. To complicate this, if dropdown D = 1, for example, A = B + C, if dropdown D = 2, A = C *...
5
by: Hans Kesting | last post by:
Hi, I have a pulldown with both AutoPostback set to true and a validator. When I select an "invalid" value from the pulldown, the validator message shows briefly, then a postback occurs and the...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
4
by: tshad | last post by:
I am trying to fire the CustomValidator when I leave the Email field. Following is the code. It does PostBack, but the CustomValidator doesn't seem to be firing. <asp:TextBox...
1
by: =?Utf-8?B?SlA=?= | last post by:
Using C#, I have a screen that allows the user to enter a ZipCode. When focus is lost, the field is configured to do an autopostback to make several calculations and pre-populate several other...
37
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.