RequiredFieldValidator inside ModalPopup causing problems - asp.net

I have an ASP.NET 3.5 form with several fields and a sub form inside a ModalPopup. The problem I'm having is with a RequiredFieldValidator inside the ModalPopup. For some reason it is preventing post back inside the ModalPopup. Both the validator and the submit buttons have the same ValidationGroup that is unique to them. Here is the markup for the sub form:
<%# Control Language="C#" AutoEventWireup="true" CodeFile="RoomBuilder.ascx.cs" Inherits="Admin_Controls_RoomBuilder" %>
<link href="../../../../style/FlexStyle.css" rel="stylesheet" type="text/css" id="style"
runat="server" visible="false" />
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="form" style="width: 420px; height: 500px; padding: 3px; position: relative;
text-align: center;">
<div style="width: 280px">
<div class="item smalltitle ">
Title:
</div>
<div class="item">
<asp:TextBox ID="txtTitle" runat="server" Width="250px"></asp:TextBox>
</div>
<div class="item smalltitle gapontop">
Description:
</div>
<div class="item">
<asp:TextBox ID="txtDesc" runat="server" Width="250px" Height="40px" TextMode="MultiLine"></asp:TextBox>
</div>
<div class="item gapontop">
<div class="smalltitle floatLeft" style="width: 120px;">
Room Number
</div>
<div class="smalltitle floatLeft" style="width: 120px;">
Phone
</div>
</div>
<div class="item">
<div class="floatLeft" style="width: 120px;">
<asp:TextBox ID="txtRoomNo" runat="server" Width="100px"></asp:TextBox>
</div>
<div class="floatLeft" style="width: 120px;">
<asp:TextBox ID="txtPhone" runat="server" Width="100px"></asp:TextBox>
</div>
</div>
<div class="item smalltitle gapontop ">
Type:
</div>
<div class="item">
<asp:TextBox ID="txtType" runat="server" Width="250px"></asp:TextBox>
</div>
<div class="item smalltitle gapontop ">
Number of Seats:
<asp:RequiredFieldValidator ID="RequiredFieldValidatortxtNoSeats" runat="server" ErrorMessage="*"
ControlToValidate="txtNoSeats" ValidationGroup="roomVal"></asp:RequiredFieldValidator>
</div>
<div class="item">
<asp:TextBox ID="txtNoSeats" runat="server" Width="50px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Not a number"
ControlToValidate="txtNoSeats" ValidationGroup="roomVal" ValidationExpression="[0-9]*"></asp:RegularExpressionValidator>
</div>
</div>
<!-- ************************************ -->
<div class="topBorder" style="width: 100%; height: 35px; position: absolute; bottom: -8px;
right: 2px; text-align: right; padding-top: 11px;">
<asp:Button ID="btnCancel" runat="server" CssClass="button" Text="Cancel" CausesValidation="false"
OnClick="btnCancel_Click" ValidationGroup="roomVal" />
<asp:Button ID="btnSave" runat="server" CssClass="button" Text="Save" OnClick="btnSave_Click" CausesValidation="true" ValidationGroup="roomVal" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
When the validator is removed (or CausesValidation is set to false), the sub form posts. RegularExpressionValidators don't have this problem. I've run FireBug, but I'm not seeing any obvious errors.
Is there something I'm missing?

Oh my god I'm so stupid!! >:(
Found the reason for the problem. There was another copy of the same control nested inside another control. And (of course) having the same ValidationGroup name as my first control all Required Field Validators fail to work!
Argh! Candidate for a Daily WTF!
Sorry to have wasted everybody's time :(

Can you please check if your Button (or some other control) that open the popup and the modaldialog extender are outside the update panel?

I got strange problems with modalpopup too. I would suggest you to try something different, for example a numericupdown control from the ajaxcontroltoolkit, if you already use it. So you don't need any validator for this.
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<div class="item smalltitle gapontop ">
Number of Seats:
</div>
<div class="item">
<asp:TextBox ID="txtNoSeats" runat="server" Width="50px"></asp:TextBox>
<cc1:NumericUpDownExtender ID="txtNoSeatsExt" runat="server"
Enabled="true" Minimum="1" Maximum="100" TargetControlID="txtNoSeats" Width="50" />
</div>

Related

link in the repeater first time only working inside the update panel control

I have link buttons for showing gridview and list view and also I have paging using datalist control all these being within the updatepanel.
Paging and listview link button and gridview link button working fine in the first load but the problem is when I'm doing any action within update panel like moving to next page or change gridview to listview then the <a> tag link within the repeator control is not working.
I have order buton inside the repeator control this will give the modal pop up for quantity selection and add to cart option but <a> tag not working it does not show modal.
This <a> tag is not working:
<a class="cur-pointer order button"
data-uid="<%#Container.DataItem("unit")%>"
data-uname="<%#Container.DataItem("UnitName")%>"
data-price="<%#Container.DataItem("price")%>"
data-pro-name="<%#Container.DataItem(productName)%>"
data-iid="<%#Container.DataItem("ItemId")%>">
<strong>
<asp:Literal runat="server" Text="<%$Resources:Resource,Order %>"></asp:Literal>
</strong>
</a>
full code here :
<div class="row" style="padding: 0px 0px 41px 0px;">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="sort-grid">
<div class="col-md-4 ">
<div class="sorting hiddenview">
<asp:LinkButton ID="gridlink" runat="server" CssClass="icongridlist"><i class="gridicon"></i></asp:LinkButton>
<asp:LinkButton ID="listlink" runat="server" CssClass="icongridlist"><i class="fa fa-list" style="color:#fff;"></i></asp:LinkButton>
</div>
</div>
<div class="col-md-4 col-md-offset-4">
<div class="sorting pagingdropdownmob">
<%-- style="width: 91px;"--%>
<h6>Show</h6>
<asp:DropDownList runat="server" ID="dropdownlist" Style="width: 42px;" AutoPostBack="True" OnSelectedIndexChanged="lbtnFirst_Click">
<%--AppendDataBoundItems = "true"--%>
<asp:ListItem Selected="True" Text="10" Value="10"></asp:ListItem>
<asp:ListItem Text="15" Value="15"></asp:ListItem>
<asp:ListItem Text="30" Value="30"></asp:ListItem>
<asp:ListItem Text="45" Value="45"></asp:ListItem>
</asp:DropDownList>
<div class="clearfix"></div>
</div>
<div class="sorting paginglistmob">
<h6>Page: </h6>
<%-- <asp:LinkButton ID="lbtnFirst" runat="server" CausesValidation="false" OnClick="lbtnFirst_Click" ></asp:LinkButton> --%>
<asp:LinkButton ID="lbtnPrevious" runat="server" CausesValidation="false" OnClick="lbtnPrevious_Click"><i class="fa fa-caret-left hoverclr"></i></asp:LinkButton>
<span>
<asp:DataList ID="dlPaging" runat="server" RepeatDirection="Horizontal" OnItemCommand="dlPaging_ItemCommand"
OnItemDataBound="dlPaging_ItemDataBound" Style="display: inline-block;">
<ItemTemplate>
<asp:LinkButton ID="lnkbtnPaging" runat="server" Style="color: #000;" CommandArgument='<%# Eval("PageIndex") %>'
CommandName="Paging" Text='<%# Eval("PageText") %>'></asp:LinkButton>
</ItemTemplate>
</asp:DataList>
<asp:LinkButton ID="lbtnNext" runat="server" CausesValidation="false"
OnClick="lbtnNext_Click"><i class="fa fa-caret-right hoverclr"></i></asp:LinkButton></span>
<%-- <asp:LinkButton ID="lbtnLast" runat="server" CausesValidation="false" OnClick="lbtnLast_Click">Last</asp:LinkButton></span>--%>
</div>
</div>
<div class="clearfix"></div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row">
<asp:UpdatePanel ID="UpdatePanel3" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="single-pro">
<asp:PlaceHolder ID="phItem" runat="server" Visible="false">
<asp:Repeater ID="rptItem" runat="server">
<ItemTemplate>
<div class="col-md-3 col-sm-6 product-men">
<%-- col-md-4 col-sm-6--%>
<div class="men-pro-item simpleCart_shelfItem">
<div class="men-thumb-item">
<a href="javascript:void(0);">
<img alt="" class="pro-image-front" src="<%#Container.DataItem("ImageSrc")%>">
<img alt="" class="pro-image-back" src="<%#Container.DataItem("ImageSrc")%>">
</a>
<div class="men-cart-pro" style="padding-bottom: 8px;">
<div class="inner-men-cart-pro">
<asp:LinkButton runat="server"><i class="glyphicon glyphicon-zoom-in"></i> View</asp:LinkButton>
</div>
</div>
</div>
<%--men thumb item--%>
<div class="item-info-product ">
<h5 style="font-size: 16px; font-weight: 900; padding-left: 0px; padding-right: 0px; height: 42px; line-height: 17px;" class="m-none h-initial"><strong><%#Container.DataItem(productName)%></strong></h5>
<%--height:33px;--%>
<div class="info-product-price">
<strong><span class="item_price"><%#Container.DataItem("price")%> </span><%=GetGlobalResourceObject("Resource", "Currency")%><span> /<%#Container.DataItem("UnitName")%></span>
</div>
<div class="snipcart-details top_brand_home_details item_add single-item link-product-add-cart ">
<a class="cur-pointer order button" data-uid="<%#Container.DataItem("unit")%>" data-uname="<%#Container.DataItem("UnitName")%>" data-price="<%#Container.DataItem("price")%>" data-pro-name="<%#Container.DataItem(productName)%>" data-iid="<%#Container.DataItem("ItemId")%>"><strong>
<asp:Literal runat="server" Text="<%$Resources:Resource,Order %>"></asp:Literal></strong> </a>
</div>
</div>
<%-- item info product--%>
</div>
<%-- menproitem--%>
</div>
<%--colmd3--%>
</ItemTemplate>
</asp:Repeater>
</asp:PlaceHolder>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row">
Because the Repeater is in an UpdatePanel, you need to rebind the data attributes after Async PostBack. Because the PostBack updates the UI and previous bindings are lost.
<script type="text/javascript">
$(document).ready(function () {
bindDataAttributes();
});
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function () {
bindDataAttributes();
});
function bindDataAttributes() {
//call the jquery function that binds data-uid etc here
}
</script>
You need to populate the repeater on each postback. The best place for this is the OnInit event.

ASP Update Progress control never comes back, continues to display progress bar

I have a web page that contains a UpdateProgress control. When I execute the following code the progress bar displays and never goes away.
protected void lnkBtnName_Click(object sender, EventArgs e)
{
int index = ((GridViewRow)((LinkButton)sender).Parent.Parent).RowIndex;
hdnGvSelectedIndex.Value = index.ToString();
SetPageContent();
}
private void SetPageContent()
{
try
{
ResetControls();
if (gv.Rows.Count > 0)
{
index = Convert.ToInt32(hdnGvSelectedIndex.Value);
id = Convert.ToInt64(gv.DataKeys[index].Values[0].ToString());
hdnID.Value = id.ToString();
if (gv.Rows.Count > 0)
gv.SelectedIndex = index;
}
var _obj = _manager.GetByID(id).FirstOrDefault();
if (_obj != null)
{
txtName.Text = _obj.Name;
txtDisplayName.Text = _obj.DisplayName;
}
}
catch (Exception ex)
{
// Error processing
}
}
The web page...
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div style="text-align: center;">
<asp:UpdateProgress ID="updateProgress" runat="server">
<ProgressTemplate>
<div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
<asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="Content/img/loader.gif" AlternateText="Loading ..." ToolTip="Loading ..." Style="padding: 10px; position: fixed; top: 45%; left: 50%;" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
<asp:UpdatePanel ID="updpnlContentDetail" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField runat="server" ID="hdnEnvironmentType" />
<asp:HiddenField runat="server" ID="hdnID" />
<asp:HiddenField runat="server" ID="hdnGvSelectedIndex" Value="0" />
<asp:HiddenField runat="server" ID="hdnButtonPermission" Value="0" />
<asp:HiddenField runat="server" ID="hdnSelectedTab" Value="0" />
<asp:HiddenField runat="server" ID="hdnButtonStatus" Value="Active" />
<div class="row">
<div class="col-md-3">
<h5>Manage Detail</h5>
<div class="filterWrapper relative" id="dvLeftcontentdetail">
<div class="clearfix whiteBg">
<div class="pull-left">
<label>Bucket Type</label>
</div>
<div class="pull-right">
<span class="addBtn">Add
<asp:Button ID="lnkbtnAdd" runat="server" OnClick="lnkbtnAdd_Click" CssClass="btn btn-add pull-right"></asp:Button>
</span>
</div>
</div>
<div class="input-group clearfix col-sm-12">
<asp:TextBox CssClass="form-control height26" ID="txtSearchName" runat="server"></asp:TextBox>
<span class="input-group-btn">
<asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" CssClass="btn btn-black glyphicons filter btn-icon white input-group-btnbtnmargin"></asp:Button>
<i></i>
</span>
</div>
<div id="divgv">
<div id="" class="gridview2 relative" style="height: 424px;">
<asp:GridView CssClass="gridview" ID="gv" runat="server" DataKeyNames="ID" PageSize="13" OnPageIndexChanging="gv_PageIndexChanging" ShowHeader="False"
AutoGenerateColumns="false" AllowPaging="true">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblID" runat="server" Visible="false" Text='<%#Eval("ID") %>' />
<asp:LinkButton ID="lnkBtnShowContentDetail" runat="server" Text='<%#Eval("Name") %>' CommandName="Select" OnClick="lnkBtnName_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle CssClass="gridview-pager"></PagerStyle>
<SelectedRowStyle CssClass="gvSelectedRow" />
</asp:GridView>
<div id="content"></div>
<div class="filterResults relative btnGroup">
<div class="btn-groupSpecial">
<asp:Button ID="lnkbtnActive" runat="server" Text="Active" OnClick="lnkbtnActive_Click" OnClientClick="return ConfirmMessage(4); " CssClass="results-control col-xs-4 active"></asp:Button>
<asp:Button ID="lnkbtnInActive" runat="server" Text="InActive" OnClick="lnkbtnInActive_Click" OnClientClick="return ConfirmMessage(5);" CssClass="results-control col-xs-4"></asp:Button>
<asp:Button ID="lnkbtnAll" runat="server" Text="All" OnClick="lnkbtnAll_Click" CssClass="results-control col-xs-4" OnClientClick="return ConfirmMessage(6);"></asp:Button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-9">
<h5>Details</h5>
<div id="dvRightContent" class="row clearfix relative btnGroup btnGroup3" style="height: 492px;">
<div class="tabControls">
<ul class="nav nav-tabs">
<li class="col-xsm-100 nav-tabs-content active"><span class="linkDisabledsp"> </span><a data-toggle="tab" href="#manageDetailTab" onclick="SetSelectedTab('contentTab')">Bucket Details</a></li>
</ul>
<div class="row">
<div class="col-md-12">
<div class="col-md-4">
<label for="iconName">Name</label>
<asp:TextBox CssClass="form-control" ID="txtName" MaxLength="250" runat="server"></asp:TextBox>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-4">
<label for="iconName">Display Name</label>
<asp:TextBox CssClass="form-control" ID="txtDisplayName" MaxLength="250" runat="server"></asp:TextBox>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
</div>
</div>
<div class="col-md-12 btnGroup2 row navbar-fixed-bottom">
<div class="btn-groupSpecial clearfix">
<asp:Button ID="lnkbtnSave" OnClientClick="return FormValidation();" runat="server" Text="Save" OnClick="lnkbtnSave_Click" CssClass="results-control col-xsm-32"></asp:Button>
<asp:Button ID="lnkbtnCancel" runat="server" OnClientClick=" return ConfirmMessage(2);" Text="Cancel" OnClick="lnkbtnCancel_Click" CssClass="results-control col-xsm-32"></asp:Button>
<asp:Button ID="lnkbtnDelete" runat="server" OnClientClick="return ConfirmMessage(3);" Text="Delete" OnClick="lnkbtnDelete_Click" CssClass="results-control col-xsm-32"></asp:Button>
</div>
</div>
</div>
</div>
</div>
<div id="AlertBox" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h4 class="modal-title">Alert</h4>
</div>
<div class="modal-body">
<p id="alertMessage" runat="server"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn" id="btnOK" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<!-- Modal Dialog -->
<div id="ConfirmBox" class="modal fade" role="dialog" aria-labelledby="confirmDeleteLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h4 class="modal-title">Confirm?</h4>
</div>
<div class="modal-body">
<p id="ConfirmBoxMessage"></p>
</div>
<div class="modal-footer">
<asp:Button ID="btnConfirmedSave" CssClass="btn btn-danger" runat="server" Text="OK" UseSubmitBehavior="false" data-dismiss="modal" OnClick="lnkbtnSave_Click" Style="display: none;"></asp:Button>
<asp:Button ID="btnConfirmedCancel" CssClass="btn btn-danger" runat="server" Text="OK" UseSubmitBehavior="false" data-dismiss="modal" OnClick="lnkbtnCancel_Click" Style="display: none;"></asp:Button>
<asp:Button ID="btnConfirmedDelete" CssClass="btn btn-danger" runat="server" Text="OK" UseSubmitBehavior="false" data-dismiss="modal" OnClick="lnkbtnDelete_Click" Style="display: none;"></asp:Button>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
Why is the UpdateProgress control not returning?
Thanks
Try to set the AssociatedUpdatePanelID property of the progress control.
The UpdateProgress control renders a <div> element that is displayed
or hidden depending on whether an associated UpdatePanel control has
caused an asynchronous postback.
So you are Missing that Associated UpdatePanelID that has caused the asynchronous Postback
Try to change your update Progress as follows:
<div style="text-align: center;">
<asp:UpdateProgress ID="updateProgress" AssociatedUpdatePanelID ="updpnlContentDetail" runat="server">
<ProgressTemplate>
<div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
<asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="Content/img/loader.gif" AlternateText="Loading ..." ToolTip="Loading ..." Style="padding: 10px; position: fixed; top: 45%; left: 50%;" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
For More Information about Update Progress refer this Source

What is the way to preserve web user control to postback whole webform

In my ASP.NET web project, i am using a web user control in a web form to generate insert/update/delete operations for the data in the web form.
<asp:UpdatePanel runat="server" ID="ctlUcusUpdatePanel">
<ContentTemplate>
<uc1:UcusBilgileriEditor runat="server" ID="ctlUcusBilgileriEditor" />
<%-- Here I have a grid to display data--%>
</ContentTemplate>
</asp:UpdatePanel>
Here is my user control:
<asp:UpdatePanel ID="ctlEditorUpdatePanel" runat="server">
<ContentTemplate>
<asp:Panel runat="server" ID="ctlEditorContentPanel" Visible="false">
<div class="panel panel-primary" id="ctlUcusBilgiModal" style="position: relative; top: auto; left: auto; right: auto; margin: 0 auto 20px; z-index: 1; width: 100%; display: none">
<div class="panel-heading">
<div class="panel-title">
<hzg:HZGLiteral runat="server" ID="ctlModalTitle"></hzg:HZGLiteral>
</div>
</div>
<div class="panel-body" style="padding: 20px 20px 2px 2px;">
<ul id="myTab" class="nav nav-tabs">
<li class="active">Genel</li>
<li class="">Uçuş Detayları</li>
<li class="">Açıklamalar</li>
</ul>
<div class=tab-content>
<div class="form-group col-sm-1">
<label class="control-label" for="<%= ctlFlightMoveType.ClientID %>">
<asp:Literal runat="server" ID="ctlFLightMoveLiteral" meta:resourcekey="ctlFlightMoveTypeLiteral" />
</label>
<hzg:HZGRadioButtonList ID="ctlFlightMoveType"
AutoPostBack="true"
CellPadding="3"
RepeatColumns="5"
RepeatDirection="Vertical"
TextAlign="Right"
runat="server"
DataValueField="INISMI"
EnumType="HZG.Core.Model.Enums.FlightMove"
OnSelectedIndexChanged="ctlFlightMoveType_SelectedIndexChanged">
</hzg:HZGRadioButtonList>
</div>
</div>
</div>
<div class="panel-footer" style="text-align: right">
<hzg:HZGButton ID="ctlSaveButton" runat="server" ButtonDesign="success" ButtonSize="small" Text="Kaydet" OnClick="ctlSaveButton_Click" meta:resourcekey="ctlSaveButton" RolePermission="Admin,PowerUser,User" />
<hzg:HZGButton ID="ctlDeleteButton" runat="server" ButtonDesign="danger" ButtonSize="small" Text="Delete" OnClick="ctlDelete_Click" meta:resourcekey="ctlDeleteButton" OnClientClick='<%$ Resources:GlobalResource, AreYouSure%>' RolePermission="Admin,PowerUser,User" />
<hzg:HZGButton ID="ctlCloseButton" runat="server" ButtonDesign="primary" ButtonSize="small" Text="İptal" OnClick="ctlCloseButton_Click" meta:resourcekey="ctlCloseButton" />
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
When I click on a radiobutton in my RadiButtonList, ctlFlightMoveType_SelectedIndexChanged event is triggered; and when this happens, i want only my user control to postback but my web form postback and the user control is closed.
I dont want the webform to postback, i want only user control. How can i do this?
Please, read the AJAX overview, you can also read up about ScriptManager and UpdatePanel. Using UpdatePanel you can achieve the feature described in your question.
On your user control update panel make sure you have childrenastriggers=true. And on the script manager declaration (in your main page) make sure you have enablepartialupdates selected.
If it's still forcing a full post back, chances are you have some iffy html somewhere on the page.

using inline content in jquery thickbox

I use JQuery ThickBox 3.1 , and here is my code
<telerik:RadListView runat="server" ID="myDataList" AllowPaging="true"
DataKeyNames="id" ItemPlaceholderID="PlaceHolder1"
NeedDataSource="list_DataRebind">
<LayoutTemplate>
<div class="sushibar">
<asp:Panel ID="SushiPanel" runat="server">
<div class="sushi">
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</div>
<telerik:RadDataPager ID="RadDataPager1" runat="server" PageSize="4" PagedControlID="myDataList">
<Fields>
<telerik:RadDataPagerButtonField />
<telerik:RadDataPagerPageSizeField />
<telerik:RadDataPagerSliderField />
</Fields>
</telerik:RadDataPager>
</asp:Panel>
</div>
</LayoutTemplate>
<ItemTemplate>
<div class="imageDiv">
<span style="margin-bottom: 5px; display: block; color: #FF6600; font-weight: bold;">
<%#Eval("Title") %></span>
<br />
<a href='<%#Eval("ImagePath")%>' title='<%#Eval("Title")%>' class="thickbox" >
<img src='<%#Eval("ImagePath")%>' alt="Single Image" width="150px" height="200px" /></a></div>
</ItemTemplate>
</telerik:RadListView>
Popup box with Image and Title show correctly , but I have another field(<%#Eval("Description")%>) to show with it !
I found how to show Inline Content in Thickbox ,
<input alt="#TB_inline?height=300&width=400&inlineId=myOnPageContent" title="add a
caption to title attribute / or leave blank" class="thickbox" type="button" value="Show" />
<a href="#TB_inline?height=155&width=300&inlineId=hiddenModalContent&modal=true"
class="thickbox">Show hidden modal content.</a>
But I don't know how to use this in a ListView !
:D , I found the answer ! Just put the contents ( Image + Description ) to hidden division (style with Display:none) and set this div id to inlineId .
<ItemTemplate>
<div class="imageDiv">
<span style="margin-bottom: 5px; display: block; color: #FF6600; font-weight: bold;">
<%#Eval("Title") %></span>
<br />
<div id="popUpRegion" style="display: none">
<img src='<%#Eval("ImagePath")%>' alt="Single Image" width="500px" height="600px" />
<p>
<%#Eval("Description")%></p>
</div>
<a href="#TB_inline?height=800&width=600&inlineId=popUpRegion" title='<%#Eval("Title")%>'
class="thickbox">
<img src='<%#Eval("ImagePath")%>' alt="Single Image" width="150px" height="200px" /></a></div>
</ItemTemplate>

this._form is null error with ScriptManager and Ajax Control Toolkit

I'm using the Ajax Control Toolkit with .NET in VS2008 to put a Rating control on my page. I've got the scriptmanager on the page and the rating control works in Chrome and IE but not Firefox. In Firefox it gives me this error "this._form is null". I've got no other scripts included on the page. There are a couple included in the master page but they are closed with </script>. I've tried using ToolkitScriptManager but it hasn't changed anything.
<form id="aspnetForm" runat="server"><ajaxToolkit:ToolkitScriptManager id="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" EnablePartialRendering="true" SupportsPartialRendering="true" />
<div id="main" align='center'>
<div id="inside">
<div id="nav">
<div id="photoCount"><label id="lblPhotoCount" runat="server"></label></div>
<div id="photoNav">
<a class="nav_a" runat="server" id="previouslink" href="">Previous</a><a class="nav_a" runat="server" id="nextlink" href="">Next</a>
</div>
<div class="clear"></div>
</div>
<div id="divBrowseBox" runat="server">
<div id='divPicHeader' runat='server' style="z-index: 2998">
</div>
</div>
<div id="likeArea">
<iframe id="likeIframe" runat="server" src="" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:80px;" allowTransparency="true"></iframe>
</div>
<div id="ratingArea">
<asp:updatepanel id="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:HiddenField ID="hdnCurrentPhotoID" runat="server" />
<asp:HiddenField ID="hdnCurrentRating" runat="server" />
<asp:HiddenField ID="hdnAvgRating" runat="server" />
<asp:HiddenField ID="hdnTotalVotes" runat="server" />
<asp:HiddenField ID="hdnAddRating" runat="server" />
<asp:Label ID="lblYourVote" runat="server" Font-Size="12px" Text="Rate This Photo!"></asp:Label>
<div id="starbox">
<div id="stars">
<ajaxToolkit:Rating ID="Rating1" runat="server"
CurrentRating="3"
MaxRating="5"
StarCssClass="ratingStar"
WaitingStarCssClass="savedRatingStar"
FilledStarCssClass="filledRatingStar"
EmptyStarCssClass="emptyRatingStar"
OnChanged="Rating1_Changed"
AutoPostBack="true"
BehaviorID="rbid"
>
</ajaxToolkit:Rating>
</div>
</div>
<div style="clear: both;"></div>
<asp:Label ID="lblTotalVotes" runat="server" Font-Size="10px" Text=""></asp:Label>
</ContentTemplate>
</asp:updatepanel>
</div>
<div style="clear: both;"></div>
</div>
</div>
</form>
Updated with code. There are only some styles above the form and that is all.
I answered my own question. I was trying to create a form within a form and it wasn't working. I didn't get any indication of that from the error messages but eventually figured it out.

Resources