473,383 Members | 1,717 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,383 software developers and data experts.

validation control interfering?

Hi all,

I have reduced my panelled page for simplified viewing below. In it I have
3 panels that I would to display/hide depending on the button pressed. It
seemed very straight forward to begin with, but my page is acting the way it
should. When I go to click the first button on the pnlAddBooking panel it
won't show me the pnlClientSearch panel and I am wondering if it because of
my validation control. What am I missing? It's gotta be something
simple..man.

Cheers, Lerp
Code:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<script language="vb" runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)

IF NOT Page.IsPostBack THEN
pnlAddBooking.Visible = true
pnlClientSearch.Visible = false
pnlError.Visible = false
END IF

End Sub

'SUB FOR BUTTONS
Sub buttonClick(Sender As Object, e As
system.Web.UI.WebControls.CommandEventArgs)
IF e.CommandName = "csearch" THEN
pnlAddBooking.Visible = false
pnlError.Visible = false
pnlClientSearch.Visible = true
ELSEIF e.CommandName = "booking" THEN
pnlError.Visible = false
pnlClientSearch.Visible = false
pnlAddBooking.Visible = true
ELSE
pnlAddBooking.Visible = false
pnlClientSearch.Visible = false
pnlError.Visible = true
END IF
End Sub
</script>


<!--- START OF EMPLOYEE GRID --->
<form runat="server" method="post">
<asp:panel id="pnlAddBooking" runat="server" style="Z-INDEX: 101; POSITION:
absolute;">

<!--- MASTER TABLE --->
<table width="790" cellpadding="2" cellspacing="0" border="0">
<tr valign="top">
<td align="left">BOOKING ADD PANEL.&nbsp;&nbsp;<asp:Button
ID="btnCScaller" CssClass="but" CommandName="csearch"
OnCommand="buttonClick" text="Client Search" Runat="server" /></td>
</tr>
</table>

<tr height="15">
<td align="left" colspan="5"></td>
</tr>
<tr valign="top">
<td align="left" class="bodycopy">Salutation:</td>
<td align="left" class="bodycopy">
<asp:ListBox id="salutation" Rows="1" SelectionMode="Single"
CssClass="textbox" runat="server" AutoPostBack="true">
<asp:ListItem Value="" Text="Select One"/>
<asp:ListItem Value="Mr." Text="Mr."/>
<asp:ListItem Value="Mrs." Text="Mrs."/>
<asp:ListItem Value="Miss" Text="Miss"/>
<asp:ListItem Value="Dr." Text="Dr."/>
<asp:ListItem Value="Ms." Text="Ms."/>
<asp:ListItem Value="Master" Text="Master"/>
</asp:ListBox>&nbsp;
<asp:RequiredFieldValidator id="salutationval"
ControlToValidate="salutation" CssClass="bodyreq" Display="Dynamic"
Width="100%" ErrorMessage="Please select a salutation." RUNAT="server" />
</td>
</tr>
</asp:panel>


<asp:panel id="pnlError" runat="server" style="Z-INDEX: 102; POSITION:
absolute;">
<!--- MASTER TABLE --->
<table width="790" cellpadding="2" cellspacing="0" border="0">
<tr valign="top">
<td align="left">ERROR PANEL</td>
</tr>
</table>
</asp:panel>



<asp:panel id="pnlClientSearch" runat="server" style="Z-INDEX: 103;
POSITION: absolute;">
<table width="790" cellpadding="2" cellspacing="0" border="0">
<tr valign="top">
<td align="left">CLIENT SEARCH PANEL&nbsp;&nbsp;<asp:Button
ID="btnCScallerb" CssClass="but" CommandName="booking"
OnCommand="buttonClick" text="Add Booking" Runat="server" /></td>
</tr>
</table>
</asp:panel>


</form>

Nov 18 '05 #1
1 1459
Oops , sorry I forgot about the CausesValidation="false" property of the
button class :)

Thx, Lerp
"Lerp" <ad***@officience.ca> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I have reduced my panelled page for simplified viewing below. In it I have 3 panels that I would to display/hide depending on the button pressed. It
seemed very straight forward to begin with, but my page is acting the way it should. When I go to click the first button on the pnlAddBooking panel it
won't show me the pnlClientSearch panel and I am wondering if it because of my validation control. What am I missing? It's gotta be something
simple..man.

Cheers, Lerp
Code:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<script language="vb" runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)

IF NOT Page.IsPostBack THEN
pnlAddBooking.Visible = true
pnlClientSearch.Visible = false
pnlError.Visible = false
END IF

End Sub

'SUB FOR BUTTONS
Sub buttonClick(Sender As Object, e As
system.Web.UI.WebControls.CommandEventArgs)
IF e.CommandName = "csearch" THEN
pnlAddBooking.Visible = false
pnlError.Visible = false
pnlClientSearch.Visible = true
ELSEIF e.CommandName = "booking" THEN
pnlError.Visible = false
pnlClientSearch.Visible = false
pnlAddBooking.Visible = true
ELSE
pnlAddBooking.Visible = false
pnlClientSearch.Visible = false
pnlError.Visible = true
END IF
End Sub
</script>


<!--- START OF EMPLOYEE GRID --->
<form runat="server" method="post">
<asp:panel id="pnlAddBooking" runat="server" style="Z-INDEX: 101; POSITION: absolute;">

<!--- MASTER TABLE --->
<table width="790" cellpadding="2" cellspacing="0" border="0">
<tr valign="top">
<td align="left">BOOKING ADD PANEL.&nbsp;&nbsp;<asp:Button
ID="btnCScaller" CssClass="but" CommandName="csearch"
OnCommand="buttonClick" text="Client Search" Runat="server" /></td>
</tr>
</table>

<tr height="15">
<td align="left" colspan="5"></td>
</tr>
<tr valign="top">
<td align="left" class="bodycopy">Salutation:</td>
<td align="left" class="bodycopy">
<asp:ListBox id="salutation" Rows="1" SelectionMode="Single"
CssClass="textbox" runat="server" AutoPostBack="true">
<asp:ListItem Value="" Text="Select One"/>
<asp:ListItem Value="Mr." Text="Mr."/>
<asp:ListItem Value="Mrs." Text="Mrs."/>
<asp:ListItem Value="Miss" Text="Miss"/>
<asp:ListItem Value="Dr." Text="Dr."/>
<asp:ListItem Value="Ms." Text="Ms."/>
<asp:ListItem Value="Master" Text="Master"/>
</asp:ListBox>&nbsp;
<asp:RequiredFieldValidator id="salutationval"
ControlToValidate="salutation" CssClass="bodyreq" Display="Dynamic"
Width="100%" ErrorMessage="Please select a salutation." RUNAT="server" />
</td>
</tr>
</asp:panel>


<asp:panel id="pnlError" runat="server" style="Z-INDEX: 102; POSITION:
absolute;">
<!--- MASTER TABLE --->
<table width="790" cellpadding="2" cellspacing="0" border="0">
<tr valign="top">
<td align="left">ERROR PANEL</td>
</tr>
</table>
</asp:panel>



<asp:panel id="pnlClientSearch" runat="server" style="Z-INDEX: 103;
POSITION: absolute;">
<table width="790" cellpadding="2" cellspacing="0" border="0">
<tr valign="top">
<td align="left">CLIENT SEARCH PANEL&nbsp;&nbsp;<asp:Button
ID="btnCScallerb" CssClass="but" CommandName="booking"
OnCommand="buttonClick" text="Add Booking" Runat="server" /></td>
</tr>
</table>
</asp:panel>


</form>

Nov 18 '05 #2

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

Similar topics

3
by: NotGiven | last post by:
I have a web form with several fields. If I copy & paste from a RTF document into a field, the javascript validation and field length are bypassed and cause the form to fail. Any ideas?
4
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. ...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
4
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1....
2
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
2
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post...
9
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see)...
8
by: John Dalberg | last post by:
I have an aspx page that was developed initially in Dreamweaver as a regular html file. I have added a few textboxes and required validators. The problem is that the client side validation is not...
2
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.