I want to show different content to the user depending on the view he is using. For that, i customized the AppointmentTemplate and the AppointmentCreated event. I want also to show appointments with dynamic height, meaning they expand to fill the content but on days its got nothing it shrinks.
Whats happening is that on MonthView, only the header is shown as in the photo:
And here is the DayView: photo
Here is the AppointmentCreated
protected void sched_AppointmentCreated(object sender, AppointmentCreatedEventArgs e) {
using (DBFactory link = new DBFactory()) {
int evtID = int.Parse(e.Appointment.ID.ToString());
if (evtID == 0) {
evtID = SessionManager.Instance.LastInsertedCalendarEventID;
}
CalendarEvent ce = link.GetCalendarEvent(evtID);
Label lblHeader = (Label)e.Container.FindControl("lblHeader");
Label lblDescription = (Label)e.Container.FindControl("lblDescription");
Label lbldates = (Label)e.Container.FindControl("lbldates");
Label lblParticipants = (Label)e.Container.FindControl("lblParticipants");
Label lblLocale = (Label)e.Container.FindControl("lbllocale");
switch (sched.SelectedView) {
case SchedulerViewType.DayView:
lblLocale.Text = string.Format("{0}", ce.EventLocation1.Location);
lblHeader.Text = string.Format("{0} - {1} ", ce.EventType1.EventTypeName, ce.Subject);
lblDescription.Text = string.Format("{0}", ce.Description);
lbldates.Text = string.Format("{0:hh:mm}h - {1:hh:mm}h", ce.StartDate, ce.EndDate);
lblParticipants.Text = string.Format("{0}", link.GetUsernamesFromEvent(evtID));
break;
case SchedulerViewType.WeekView:
case SchedulerViewType.MonthView:
lblLocale.Text = string.Format("{0}", ce.EventLocation1.Location);
lblHeader.Text = string.Format("{0} - {1} ", ce.EventType1.EventTypeName, ce.Subject);
lblDescription.Text = string.Format("{0}", ce.Description);
lbldates.Text = string.Format("{0:hh:mm}h - {1:hh:mm}h", ce.StartDate, ce.EndDate);
lblParticipants.Text = string.Format("{0}", link.GetInitialsFromEvent(evtID));
break;
}
}
}
and here is the complete markup
<tk:RadScheduler ID="sched" runat="server" AppointmentStyleMode="Default" DayEndTime="19:00:00" AllowInsert="true" AllowEdit="true" AllowDelete="true"
EnableDescriptionField="True" FirstDayOfWeek="Monday" LastDayOfWeek="Friday"
ShowNavigationPane="true" ShowFooter="False" StartEditingInAdvancedForm="true"
StartInsertingInAdvancedForm="true" Height="551px"
OnFormCreated="sched_FormCreated"
OnAppointmentCommand="sched_AppointmentCommand"
OnAppointmentCreated="sched_AppointmentCreated"
OnAppointmentDataBound="sched_AppointmentDataBound"
Skin="Web20">
<MonthView AdaptiveRowHeight="true" MinimumRowHeight="50" VisibleAppointmentsPerDay="30"/>
<AdvancedForm Modal="true" />
<ExportSettings OpenInNewWindow="true" FileName="SchedulerExport">
<Pdf PageTitle="Schedule" Author="Telerik" Creator="Telerik" Title="Schedule"></Pdf>
</ExportSettings>
<TimelineView UserSelectable="false" />
<AppointmentContextMenuSettings EnableDefault="true" />
<TimeSlotContextMenuSettings EnableDefault="true" />
<TimeSlotContextMenus>
<tk:RadSchedulerContextMenu ID="SchedulerTimeSlotContextMenu" runat="server">
<Items>
<tk:RadMenuItem Text="New Appointment" Value="CommandAddAppointment" />
</Items>
</tk:RadSchedulerContextMenu>
</TimeSlotContextMenus>
<AppointmentContextMenus>
<tk:RadSchedulerContextMenu runat="server" ID="ContextMenu1">
<Items>
<%--<tk:RadMenuItem Text="Ir para dia" Value="CommandNavigateDay" />--%>
<tk:RadMenuItem Text="Editar" Value="CommandEdit" />
<tk:RadMenuItem Text="Apagar" Value="CommandDelete" />
<%--<tk:RadMenuItem Text="Exportar Para PPF" Value="CommandExport"></tk:RadMenuItem>--%>
</Items>
</tk:RadSchedulerContextMenu>
</AppointmentContextMenus>
<AppointmentTemplate>
<asp:Label runat="server" ID="lblHeader" Font-Bold="true" />
<hr />
<table border="0">
<tr>
<td style=" border-color:transparent;"><span style="font-weight:bold;">Descricao: </span></td>
<td style=" border-color:transparent;"><asp:Label ID="lblDescription" runat="server" /></td>
</tr>
<tr>
<td style=" border-color:transparent;"><span style="font-weight:bold;">Participantes: </span></td>
<td style=" border-color:transparent;"><asp:Label ID="lblParticipants" runat="server" /></td>
</tr>
<tr>
<td style=" border-color:transparent;"><span style="font-weight:bold;">Duracao: </span></td>
<td style=" border-color:transparent;"><asp:Label ID="lblDates" runat="server" /></td>
</tr>
<tr>
<td style=" border-color:transparent;"><span style="font-weight:bold;">Local: </span></td>
<td style=" border-color:transparent;"><asp:Label ID="lblLocale" runat="server" /></td>
</tr>
</table>
</AppointmentTemplate>
<AdvancedInsertTemplate>
<div class="rsAdvancedEdit rsAdvancedModal" style="position: relative; margin-right: -100px">
<div class="rsModalBgTopLeft"></div>
<div class="rsModalBgTopRight"></div>
<div class="rsModalBgBottomLeft"></div>
<div class="rsModalBgBottomRight"></div>
<div class="rsAdvTitle">
<h1 class="rsAdvInnerTitle"><%# Container.Appointment.Owner.Localization.AdvancedNewAppointment %></h1>
<asp:LinkButton runat="server" ID="LinkButton1" CssClass="rsAdvEditClose"
CommandName="Cancel" CausesValidation="false" ToolTip='<%# Container.Appointment.Owner.Localization.AdvancedClose %>'>
<%# Container.Appointment.Owner.Localization.AdvancedClose%>
</asp:LinkButton>
</div>
<div class="rsAdvContentWrapper" style="background-color: #ffffff;">
<table border="0">
<tr>
<td>
<asp:Label runat="server" Text="Sumário" ID="lblSummaryHdr" /></td>
<td colspan="3">
<asp:TextBox ID="txtSubject" runat="server" CssClass="textbox" Columns="60" Text='<%# Bind("Subject") %>' /></td>
<td>
<asp:Label ID="TextBox1" runat="server" Text='<%# Bind("ID") %>' Visible="false" /></td>
</tr>
<tr>
<td>Descrição</td>
<td colspan="3">
<asp:TextBox ID="txtDescription" CssClass="textbox" Columns="60" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox><br />
</td>
</tr>
<tr>
<td>Inicío</td>
<td>
<tk:RadDateTimePicker ID="startInput" SelectedDate='<%# Bind("Start") %>' runat="server"></tk:RadDateTimePicker>
</td>
<td>Fim</td>
<td>
<tk:RadDateTimePicker ID="finishInput" SelectedDate='<%# Bind("End") %>' runat="server"></tk:RadDateTimePicker>
</td>
</tr>
<tr>
<td>Tipo</td>
<td>
<tk:RadComboBox ID="ddlEventType" runat="server" CssClass="combo" />
</td>
<td>Sala</td>
<td>
<tk:RadComboBox ID="ddlLocations" runat="server" CssClass="combo" />
</td>
</tr>
<tr>
<td>Grupos</td>
<td>
<tk:RadComboBox ID="ddlGroups" runat="server" CssClass="combo" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" />
</td>
<td>Usuários</td>
<td>
<tk:RadComboBox ID="ddlUsers" runat="server" CssClass="combo" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" />
</td>
</tr>
</table>
<asp:Panel runat="server" ID="Panel1" CssClass="rsAdvancedSubmitArea">
<div class="rsAdvButtonWrapper">
<asp:LinkButton CommandName="Insert" runat="server" ID="LinkButton2" CssClass="rsAdvEditSave">
<span><%# Container.Appointment.Owner.Localization.Save%></span>
</asp:LinkButton>
<asp:LinkButton runat="server" ID="LinkButton3" CssClass="rsAdvEditCancel" CommandName="Cancel" CausesValidation="false">
<span><%# Container.Appointment.Owner.Localization.Cancel%></span>
</asp:LinkButton>
</div>
</asp:Panel>
</div>
</div>
</AdvancedInsertTemplate>
<AdvancedEditTemplate>
<div class="rsAdvancedEdit rsAdvancedModal" style="position: relative; margin-right: -100px">
<div class="rsModalBgTopLeft"></div>
<div class="rsModalBgTopRight"></div>
<div class="rsModalBgBottomLeft"></div>
<div class="rsModalBgBottomRight"></div>
<div class="rsAdvTitle">
<h1 class="rsAdvInnerTitle"><%# Container.Appointment.Owner.Localization.AdvancedEditAppointment %></h1>
<asp:LinkButton runat="server" ID="LinkButton4" CssClass="rsAdvEditClose"
CommandName="Cancel" CausesValidation="false" ToolTip='<%# Container.Appointment.Owner.Localization.AdvancedClose %>'>
<%# Container.Appointment.Owner.Localization.AdvancedClose%>
</asp:LinkButton>
</div>
<div class="rsAdvContentWrapper" style="background-color: #ffffff;">
<table>
<tr>
<td>Sumário</td>
<td colspan="3">
<asp:TextBox ID="txtSubject" runat="server" CssClass="textbox" Columns="60" Text='<%# Bind("Subject") %>' /></td>
</tr>
<tr>
<td>Descrição</td>
<td colspan="3">
<asp:TextBox ID="txtDescription" CssClass="textbox" Columns="60" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox><br />
</td>
</tr>
<tr>
<td>Inicío</td>
<td>
<tk:RadDateTimePicker ID="RadDateTimePicker1" SelectedDate='<%# Bind("Start") %>' runat="server"></tk:RadDateTimePicker>
</td>
<td>Fim</td>
<td>
<tk:RadDateTimePicker ID="RadDateTimePicker2" SelectedDate='<%# Bind("End") %>' runat="server"></tk:RadDateTimePicker>
</td>
</tr>
<tr>
<td>Tipo</td>
<td>
<tk:RadComboBox ID="RadComboBox1" runat="server" CssClass="combo" />
</td>
<td>Sala</td>
<td>
<tk:RadComboBox ID="ddlLocations" runat="server" CssClass="combo" />
</td>
</tr>
<tr>
<td>Grupos</td>
<td>
<tk:RadComboBox ID="RadComboBox3" runat="server" CssClass="combo" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" />
</td>
<td>Usuários</td>
<td>
<tk:RadComboBox ID="RadComboBox4" runat="server" CssClass="combo" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" />
</td>
</tr>
<tr>
<td>Privado</td>
<td colspan="3">
<asp:CheckBox runat="server" ID="CheckBox1" AutoPostBack="false" Checked="false" />
</td>
</tr>
</table>
<asp:Panel runat="server" ID="Panel2" CssClass="rsAdvancedSubmitArea">
<div class="rsAdvButtonWrapper">
<asp:LinkButton CommandName="Update" runat="server" ID="LinkButton5" CssClass="rsAdvEditSave">
<span><%# Container.Appointment.Owner.Localization.Save%></span>
</asp:LinkButton>
<asp:LinkButton runat="server" ID="LinkButton6" CssClass="rsAdvEditCancel" CommandName="Cancel" CausesValidation="false">
<span><%# Container.Appointment.Owner.Localization.Cancel%></span>
</asp:LinkButton>
</div>
</asp:Panel>
</div>
</div>
</AdvancedEditTemplate>
</tk:RadScheduler>
There is a KB article on this found on the telerik site:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/auto-expand-the-height-of-the-appointment.aspx
Related
This is a homework assignment. The assignment is completed, but I just have to validate it. Normally I just research the validation errors and fix them, but this time the errors all seem to point to my closing html or head tags and I don't see what is wrong with them.
**end tag for "script" omitted, but OMITTAG NO was specified
"head" not finished but document ended
end tag for "head" omitted, but OMITTAG NO was specified
"html" not finished but document ended
end tag for "html" omitted, but OMITTAG NO was specified
missing marked section end**
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
/* <![CDATA[ */
function checkForNumber(fieldValue) {
var numberCheck = isNaN(fieldValue);
if (numberCheck == true) {
window.alert("You must enter a numeric value!");
return false;
}
else
return true;
}
function confirmPassword() {
if (document.forms[0].password_confirm.value
!= document.forms[0].password.value) {
window.alert("You did not enter the same password!");
document.forms[0].password.focus();
}
}
function billAutomatically() {
for (var i = 0; i < document.forms[0].delivery.length; ++i) {
if (document.forms[0].delivery[i].checked == true) {
document.forms[0].delivery[i].checked == false;
break;
}
}
}
function billByIssue() {
for (var i = 0; i < document.forms[0].autoRenew.length; ++i) {
if (document.forms[0].autoRenew[i].checked == true) {
document.forms[0].autoRenew[i].checked == false;
break;
}
}
}
function sameShippingInfo() {
if (document.forms[0].elements[5].checked == true) {
document.forms[0].name_shipping.value = document.forms[0].name_billing.value;
document.forms[0].address_shipping.value = document.forms[0].address_billing.value;
document.forms[0].city_shipping.value = document.forms[0].city_billing.value;
document.forms[0].state_shipping.value = document.forms[0].state_billing.value;
document.forms[0].zip_shipping.value = document.forms[0].zip_billing.value;
}
else {
document.forms[0].name_shipping.value ="";
document.forms[0].address_shipping.value ="";
document.forms[0].city_shipping.value ="";
document.forms[0].state_shipping.value ="";
document.forms[0].zip_shipping.value ="";
}
}
function addJournal() {
if (document.forms[0].elements[31].value == "")
window.alert("You must enter a journal name.");
else {
if (document.forms[0].journals.options[0] && document.forms[0].journals.options[0].value == "none")
document.forms[0].journals.options[0] = null;
var journal = new Option();
journal.text = document.forms[0].elements[31].value;
journal.value = document.forms[0].elements[31].value;
nextItem = document.forms[0].journals.length;
document.forms[0].journals.options[nextItem] = journal;
document.forms[0].elements[31].value = "";
}
}
function deleteJournal() {
var selectedItem = document.forms[0].journals.selectedIndex;
if (selectedItem == -1)
window.alert("You must select a journal name in the list.");
else
document.forms[0].journals.remove(selectedItem);
}
function changeJournal() {
var selectedItem = document.forms[0].journals.selectedIndex;
if (selectedItem == -1)
window.alert("You must select a journal name in the list.");
else {
document.forms[0].journals.options[selectedItem].value = document.forms[0].elements[31].value;
document.forms[0].journals.options[selectedItem].text = document.forms[0].elements[31].value;
}
}
function confirmSubmit() {
var submitForm = window.confirm("Are you sure you want to submit the form?");
if (document.forms[0].name_billing.value == ""
|| document.forms[0].address_billing.value == ""
|| document.forms[0].city_billing.value == ""
|| document.forms[0].state_billing.value == ""
|| document.forms[0].zip_billing.value == "") {
window.alert("You must enter your shipping information.");
return false;
}
else if (document.forms[0].area.value == ""
|| document.forms[0].exchange.value == ""
|| document.forms[0].phone.value == "") {
window.alert("You must enter your telephone number.");
return false;
}
else if (document.forms[0].userName.value == "") {
window.alert("You must enter a user name.");
return false;
}
else if (document.forms[0].password.value == ""
|| document.forms[0].password_confirm.value == "") {
window.alert("You must enter a password.");
return false;
}
var deliverySelected = false;
for (var i = 0; i < 4; ++i) {
if (document.forms[0].delivery[i].checked == true) {
deliverySelected = true;
break;
}
}
for (var j = 0; j < 2; ++j) {
if (document.forms[0].autoRenew[j].checked == true) {
deliverySelected = true;
break;
}
}
if (deliverySelected != true) {
window.alert("You must select a delivery rate option.");
return false;
}
for (var k = 0; k < document.forms[0].journals.length; ++k) {
document.forms[0].journals.options[k].selected = true;
}
return true;
}
function confirmReset() {
var resetForm = window.confirm("Are you sure you want to reset the form?");
if (resetForm == true)
return true;
return false;
}
/* ]] */
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Central Valley Technology</title>
<link href="cvtech.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="c9">
<table border="0" cellpadding="0" cellspacing="0" class="c1" width="780">
<tr>
<td height="19" colspan="3">
<img border="0" src="Images/cmpnylogo.gif" width="313" height="45" alt="Visual formatting image" />
</td>
</tr>
<tr>
<td colspan="3">
<img border="0" src="Images/blckwhtstrp.gif" width="780" height="7" alt="Visual formatting image" />
</td>
</tr>
<tr>
<td class="c2" height="19" colspan="3" align="right">
<table border="0" cellpadding="0" cellspacing="0" class="c1">
<tr>
<td>
<img border="0" src="Images/cmpny.gif" width="58" height="31" alt="Visual formatting image" />
</td>
<td>
<img border="0" src="Images/prds.gif" width="64" height="31" alt="Visual formatting image" />
</td>
<td>
<img border="0" src="Images/srvc.gif" width="59" height="31" alt="Visual formatting image" />
</td>
<td>
<img border="0" src="Images/chnprt.gif" width="110" height="31" alt="Visual formatting image" />
</td>
<td>
<img border="0" src="Images/spprt.gif" width="54" height="31" alt="Visual formatting image" />
</td>
<td>
<img border="0" src="Images/lgn.gif" width="95" height="31" alt="Visual formatting image" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" height="4">
<img border="0" src="Images/blustrp.gif" width="780" height="4" alt="Visual formatting image" />
</td>
</tr>
<tr>
<td height="166">
<img border="0" src="Images/smn1.jpg" width="265" height="166" alt="Visual formatting image" />
</td>
<td height="166">
<img border="0" src="Images/smn2.jpg" width="255" height="166" alt="Visual formatting image" />
</td>
<td height="166">
<img border="0" src="Images/smn3.jpg" width="260" height="166" alt="Visual formatting image" />
</td>
</tr>
<tr>
<td height="35">
<img border="0" src="Images/smn1a.jpg" width="265" height="35" alt="Visual formatting image" />
</td>
<td height="35">
<img border="0" src="Images/smn2a.jpg" width="255" height="35" alt="Visual formatting image" />
</td>
<td height="35">
<img border="0" src="Images/smn3a.jpg" width="260" height="35" alt="Visual formatting image" />
</td>
</tr>
<tr>
<td colspan="3" height="31">
<img border="0" src="Images/orngblckstrp.gif" width="780" height="31" alt="Visual formatting image" />
</td>
</tr>
<tr>
<td colspan="3">
<img border="0" src="Images/grystrp.gif" width="780" height="7" alt="Visual formatting image" />
</td>
</tr>
<tr>
<td height="19" colspan="3">
<div class="c10">
<h1>Technology Journal Subscription</h1>
<h2>Customer Information</h2>
<form action="FormProcessor.html" method="get" enctype="application/x-www-form-urlencoded"
onsubmit="return confirmSubmit()";
onreset="return confirmReset()";>
<table border="0">
<tr>
<td align="top">
<h3>
Billing Information
</h3>
<p>
Name<br />
<input type="text" name="name_billing"
size="56" /></p>
<p>
Address<br />
<input type="text" name="address_billing"
size="56" /></p>
<p>
City, State, Zip<br />
<input type="text" name="city_billing"
size="34" />
<input type="text" name="state_billing"
size="2" maxlength="2" />
<input type="text" name="zip_billing"
size="10" maxlength="10" /></p>
<p><input type="checkbox" onclick="sameShippingInfo();" />Same shipping information</p>
</td>
<td> </td>
<td align="top">
<h3>Shipping Information</h3>
<p>
Name<br />
<input type="text" name="name_shipping" size="56" />
</p>
<p>
Address<br />
<input type="text" name="address_shipping" size="56" />
</p>
<p>
City, State, Zip <br />
<input type="text" name="city_shipping" size="34" />
<input type="text" name="state_shipping" size="2" maxlength="2" />
<input type="text" name="zip_shipping" size="10" maxlength="5"
onblur="return checkForNumber(this.value);"/>
</p>
</td>
</tr>
</table>
<p>Telephone</p>
<p>
(<input type="text" name="area" size="3" maxlength="3" />)
(<input type="text" name="exchange" size="3" maxlength="3" />)
(<input type="text" name="phone" size="4" maxlength="4"
onblur="return checkForNumber(this.value);"/>/>)
</p>
<p>User Name<br />
<input type="text" name="userName" size="50" /></p>
<p>Password <br />
<input type="password" name="password" size="50" /></p>
<p>Confirm Password<br />
<input type="password" name="password_confirm" size="50" onblur="confirmPassword();" /></p>
<h3>Delivery Rates</h3>
<table border="0">
<colgroup align="left" width="100" />
<colgroup span="4" align="center" width="100" />
<tr><th>6 issues</th>
<th>12 issues</th>
<th>18 issues</th>
<th>24 issues</th></tr>
<tr><td><input type="radio" name="delivery" value="17.50" onclick="billByIssue();"/>$17.50</td>
<td><input type="radio" name="delivery" value="26.95" onclick="billByIssue();"/>$26.95</td>
<td><input type="radio" name="delivery" value="32.90" onclick="billByIssue()"/>$32.90</td>
<td><input type="radio" name="delivery" value="46.00" onclick="billByIssue()"/>$46.00</td></tr>
</table>
<p>
<strong>Automatic Renewal</strong>:
<input type="radio" name="autoRenew" onclick="billAutomatically()" />
Monthly ($8.95)
<input type="radio" name="autoRenew" onclick="billAutomatically();" />
Yearly ($19.95)
</p>
<p>What technologies are you interested in?</p>
<p>
<input type="checkbox" name="technologies" value="architecture" />Architecture <br />
<input type="checkbox" name="technologies" value="hardware" />Hardware <br />
<input type="checkbox" name="technologies" value="open_source" />Open source <br />
<input type="checkbox" name="technologies" value="data" />Data <br />
<input type="checkbox" name="technologies" value="windows" />Windows <br />
<input type="checkbox" name="technologies" value="networking" />Networking <br />
</p>
<p>What is your job title?</p>
<p><select name="jobTitle">
<option value="itStaff">It Staff </option>
<option value="consultant">Technical Consultant </option>
<option value="integrator">Systems Integrator </option>
<option value="manager">Manager </option>
<option value="director">Director </option>
<option value="vp">Vice President </option>
<option value="seniorManagement">CIO, CTO, CSO, CEO, COO, Chairman, President </option>
<option value="other">Other </option>
</select></p>
<p>Journal <input type="text" size="68" /></p>
<p><input type="button" value="Add Journal" onclick="addJournal();" style="width: 120px" /></p>
<p><select name="journals" multiple="multiple" size="10" style="width: 500px">
<option value="none">Enter the technologies journals you subscribe</option>
</select></p>
<input type="button" value="Delete Journal" onclick="deleteJournal()" style="width: 120px" />
<input type="button" value="Clear List" onclick="document.forms[0].journals.options.length = 0;" style="width: 120px" />
<p><input type="submit" value="Subscribe" />
<input type="reset" />
<input type="button" value="Change Journal" onclick="changeJournal()" style="width: 120px" /></p>
</form>
</div>
</td>
</tr>
<tr>
<td class="c5" height="19" colspan="3"></td>
</tr>
</table>
</div>
</body>
</html>
I have set both the header and the footer to fixed but still cannot get the content to adjust in IPhone.
Here is my layout code
<body>
<div data-role="page" #(Page.Id == null ? string.Empty : "id=" + Page.Id) data-fullscreen="false">
#* #RenderSection("MoreCode", false)*#
#if (IsSectionDefined("Header"))
{
<div data-role="header" data-position="fixed">
#RenderSection("Header", false)
</div><!-- /header -->
}
<div data-role="content">
#RenderBody()
</div><!-- /content -->
<div data-role="footer" data-tap-toggle="false" data-position="fixed">
<div class="center-wrapper">
<table border="0">
<tr>
<td>
<label for="basic">
Place Of Interest
</label>
</td>
</tr>
<tr>
<td>
<table border="0">
<tr>
<td>
Terms of Use
</td>
<td>
<label for="basic">
|
</label>
</td>
<td>
Privacy Policy
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
</body>
Here is my View
<h3 style='color:#4FA600; font-weight:bold;'>#ViewBag.Number</h3>
<table border="1" width="100%">
<tr>
<td align="center" valign=middle style=' font-weight:bold; color:#FFFFFF; background:#4FA600; '>
<label for="basic">Available Documents</label>
</td>
</tr>
<tr>
<td>
<table width="100%" height="100%">
<tr>
<td align="left" valign="middle" style=' font-weight:bold;'>
Type
</td>
<td align="center" valign="middle" style=' font-weight:bold;'>
Description
</td>
</tr>
#{
foreach(var row in Model)
{
<tr>
<td align="left" valign="middle">
#row.DocType
</td>
<td align="center" valign="middle">
#row.Description
</td>
</tr>
}
}
</table>
</td>
</tr>
</table>
Isnt jquerymobile suppose to manually adjust? It renders fine in firefox. What can I do to make the content fully display?
\The issue was I had this in my css:
[data-role=page]{height: 100% !important; position:relative !important;}
I got this code from use theme roller not sure why this messed it up. Maybe someone can clarify would be appreciated
i am system.datamodel.dataannotation for validating my views.
below is my Model for the view.
using System.ComponentModel.DataAnnotations;
public class LoginVM
{
[Required(ErrorMessage="Please provide UserName")]
public string UserName { get; set; }
public string Password { get; set; }
}
below is my view for Login
<% using (Html.BeginForm())
{ %>
<% Html.ValidationSummary(true); %>
<div style="width: 100%; height: 100%; border-style: none;">
<fieldset style="border-style: none;">
<table style="width: 100%; height: 100%; border-style: none;" border="0">
<tr>
<td style="height: 100px;" colspan="4">
</td>
<td class="editor-label" style="width: 35%; font-size: medium; vertical-align: top;
text-align: justify;">
<%: Html.Label("Sign in with your Account Credentials")%><br />
<br />
Support / Contact Us
</td>
<td style="width: 5%;">
</td>
<td style="width: 60%; border-left-width: 2px; border-left-color: #E3E3E3; border-left-style: solid;">
<table style="border-style: none;" border="0">
<tr>
<td colspan="3">
</td>
</tr>
<tr style="height: 30px;">
<td style="width: 20%;" class="login-display-label">
<%: Html.LabelFor(m=>m.UserName,"UserName :") %><br />
<br />
<%: Html.LabelFor(m=>m.Password,"Password :") %><br />
<br />
</td>
<td style="width: 182px;" colspan="2">
<%: Html.TextBoxFor(m=>m.UserName,"UserName :")%><br />
<%: Html.ValidationMessageFor(m=>m.UserName) %><br />
<%: Html.TextBoxFor(m=>m.Password,"Password :")%><br />
<%: Html.ValidationMessageFor(m=>m.Password) %><br />
</td>
</tr>
<tr>
<td>
 
</td>
<td style="width: 182px;" colspan="3">
<input type="button" id="btnSubmit" value="Submit" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
below is the scripts i have putted on my view as well as my site.master page
<script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.unobtrusive.js" type="text/javascript"></script>
i have also checked my web.config for below markup
<appSettings>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
after lots of effort my validation doesnt occur please help me....
let me known what necessary change i have to make.
thnaks in advance
change javascript Address:
<script src="#Url.Content("~/Scripts/jquery-1.5.1.js")" type="text/javascript"></script>
<script src="#Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
<script src="#Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
and Html Helper
Html.TextBoxFor(m=>m.UserName)
I have two list boxes in my view with four arrows to exchange the items between them. I am using 4 buttons with type="submit" and handling it in the controller. Is there any way that i can do it with out postback?
<table style="width:90%; text-align:center">
<thead>
<tr>
<th>Unassigned State:</th><th>
</th><th>Assigned State:</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top">
#Html.ListBoxFor(model => model.UnAssignedSelected,
new MultiSelectList(Model.UnAssignedStates, "Id",
"Name", Model.UnAssignedSelected),
new { size = "6" })
</td>
<td valign="top">
<button style=" width:50px" name="button" value="oneRightArrow" type="submit"> > </button><br />
<button style=" width:50px" name="button" value="twoRightArrow" type="submit"> >> </button><br />
<button style=" width:50px" name="button" value="oneLeftArrow" type="submit"> < </button><br />
<button style=" width:50px" name="button" value="twoLeftArrow" type="submit"> << </button>
</td>
<td valign="top">
#Html.ListBoxFor(model => model.AssignedSelected,
new MultiSelectList(Model.AssignedStates, "Id",
"Name", Model.AssignedSelected))
</td>
</tr>
</tbody>
You can use jQuery for that.
Example: http://www.meadmiracle.com/dlb/DLBDocumentation.aspx
What are other suggestions and sample code for efficiently validating the Register and/or login page. Perhaps use of jQuery?
I would like to use some ajax to inform the user the email address is in use for example.
Register.aspx
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="CreateUserWizard1" />
<asp:CustomValidator id="CustomValidator1" runat="server" ValidationGroup="CreateUserWizard1"
Display="None" EnableClientScript="False"></asp:CustomValidator>
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" oncreatinguser="Createuserwizard1_CreatingUser">
<WizardSteps>
<asp:CreateUserWizardStep runat="server" >
<ContentTemplate>
<table border="0">
<tr>
<td align="center" colspan="2">
Sign Up for Your New Account</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server"
ControlToValidate="UserName" ErrorMessage="User Name is required."
ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="Password" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="ConfirmPasswordLabel" runat="server"
AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server"
ControlToValidate="ConfirmPassword"
ErrorMessage="Confirm Password is required."
ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
</td>
<td>
<asp:TextBox ID="Email" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server"
ControlToValidate="Email" ErrorMessage="E-mail is required."
ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:CompareValidator ID="PasswordCompare" runat="server"
ControlToCompare="Password" ControlToValidate="ConfirmPassword"
Display="Dynamic"
ErrorMessage="The Password and Confirmation Password must match."
ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color:Red;">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server" />
</WizardSteps>
</asp:CreateUserWizard>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
Register.aspx.cs
protected void Createuserwizard1_CreatingUser(object sender, LoginCancelEventArgs e)
{
CreateUserWizard1.UserName.ToLower();
// Check if the user name exists or email is in use.
CreateUserWizard cuw = (CreateUserWizard)sender;
cuw.Email = cuw.UserName;
TextBox passwordTextBox =
(TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Password");
TextBox confirmPasswordTextBox =
(TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ConfirmPassword");
CustomValidator1.IsValid = false;
CustomValidator1.ErrorMessage = "I think the email is in use.";
// Save password in the textbox
passwordTextBox.Attributes.Add("Value", cuw.Password);
passwordTextBox.Attributes.Add("Value", cuw.ConfirmPassword);
e.Cancel = true;
}
protected void Button1_Click(object sender, EventArgs e)
{
CustomValidator1.IsValid = false;
CustomValidator1.ErrorMessage = "Hello errors";
}
I ended up using techniques described here http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/ to validate/