I have a panel that I want to act as an extension of ValidationSumma ry. Some fields are simply too complex for a RegEx to analyse, so I check them on a button click event and pass error messages to a Label contained in the aforementioned Panel.
Trouble is, the Panel doesn't unhide! A rougher alternative I tried, if (!IsPostBack), doesn't work either. -
<form id="Form1" method="POST" action="" runat="server">
-
<div style="width:100%">
-
<asp:ValidationSummary ID="ValidationSummary1" CssClass="errorMessage" runat="server" ForeColor="Black" />
-
</div>
-
<div style="width:100%">
-
<asp:Panel ID="customValidationSummary" runat="server" CssClass="errorMessage">
-
<asp:Label ID="msg" runat="server" />
-
</asp:Panel>
-
</div>
-
protected void btnSubmit_Click(object sender, EventArgs e)
-
{
-
msg.Text = ValidateFields(); // currently set to do nothing but return an arbitrary nonempty string
-
-
if (msg.Text == "")
-
{
-
// send data on its merry way
-
}
-
else
-
{
-
msg.Visible = true;
-
}
-
} // end function
4 2885
In addition:
The Label inside the Panel doesn't seem to want to change, either. If I leave the Panel visible and tell the text to change to an arbitrary string on button click, it doesn't. Something's fishy, but I don't know what.
Plater 7,872
Recognized Expert Expert
EDIT: Double Oops. Will have to get back to you...
An asp:panel maps back to an html DIV, do you need to nest them like that?
EDIT: Double Oops. Will have to get back to you...
An asp:panel maps back to an html DIV, do you need to nest them like that?
<div> any thinner than 100% width centres differently from <span>. The only way I've found to centre a <div> is to nest them: -
<div style="width:100%">
-
<div style="margin-left:auto;margin-right:auto">Hi there</div>
-
</div>
-
I think I figured out the source of the problem.
When there are validation controls in place, the page blocks a button click event when something isn't filled in right and pulls up a validation dialog using Javascript or somesuch. As long as there's a validation violation, there's no postback and no call of Button_Click() -- anything I put in the codebehind to check data myself won't get used.
So now the question becomes: can I circumvent this to have personalised validation and ASP validation controls report at the same time?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: dje |
last post by:
In the OnClick event on a radioButtonList, I run a javascript to
show/hide the appropriate div along with a submit button, which
displays as expected. The problem is the submit no longer works on the
button. If I quit using the divs, and do a postback on the radiobutton
selection, showing/hiding tables instead, the button is ok and
continues to work. I've tried a variety of controls instead of the
button in a variety of places but it...
|
by: Bill Long |
last post by:
I have a control that simply displays a list of links. Following one of the
links doesn't post back or redirect to another page, it simply hides the
current panel and shows the one you selected... So the behavour is similar to
a tab control.
The user is expected to fill out required data on each of the panels before
pressing a submit button which is visible from all panels.
Problem I have is validating the data entered by the user. I...
|
by: tshad |
last post by:
I am trying to hide and show certain parts of my code (which I have no
problem doing with DW). In VS 2003, it won't let you use <div
runat="server"to section of parts of my code in a table. This is during
compilation (build).
My code is:
<TABLE id="Table1" style="WIDTH: 864px; HEIGHT: 177px" cellSpacing="1"
cellPadding="1"
width="864" border="0">
|
by: vvgopal2k |
last post by:
Hi Group,
I am facing a problem in ASP.net usercontrols.
Here is the Program.
When a Click a button on the usercontrol page, a panel shows up on the same user control, this panel has some textboxes and combo boxes and button say btnSave(all are ASP:controls..).
And in the codebehind I have added btnSave.attributes.add("OnClick", "return validateForm(.........) in this function I am passing the clientID of textboxes,comboboxes(contents...
|
by: =?Utf-8?B?UHVjY2E=?= |
last post by:
--
Thanks.
| |
by: =?Utf-8?B?UHVjY2E=?= |
last post by:
Hi, I'm using vs2005, .net 2 and CR 11 Developer for a windows applicaiton.
My appl dialogs are hidden when I launch CR Preview dialog. Is CR doing
this? Is there a way to un-hide this?
Thanks.
Thanks.
|
by: mbruyns |
last post by:
i have been trying (and sometimes succeeding) to use the modalpopupextender to show various panels of controls on my asp pages. the strange problem that i keep on running into is that sometimes it works, displaying an awesome popup, while other times, it doesn't show a popup at all, but rather just page posts back and the panel becomes visible at the bottom of the page (where it is situated in the designer). what is even stranger to me is that...
|
by: andric |
last post by:
Originally I need to click on the show button then the table will collapse. But I would like to make it collapse when page onload. Need help on code below !!!
function KZAdhocBarToggleVisibility(sBarId)
{
if ( typeof(Page_KzAdhocBars)== 'undefined')
{
return;
}
var bar = null;
for( var iI = 0 ; iI < Page_KzAdhocBars.length ; iI++)
|
by: shareme |
last post by:
Hi
I am using YUI(Yahoo User Interface) Resizable panel as tool Tip.Now I need to close the panel on body click.Panel should not close if any event is performed in it .I try to close the panel by "<body onclick()>" .I thought trough that i can get the id of the element to close the panel but if i click on the panel i am getting both the id of panel (div id) followed by body id .How can i do this .Right now i am closing the panel with the...
|
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...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |