Image display using datalist - c#

Here is my code which I used image slider display image using datalist but I don't have any idea how can I display big image when image slide here is my code:
<div id="photos" class="galleryview">
<img src="images/home_gallery/banner1.jpg" />
<div style="margin: 30px 0px 0px 0px">
<asp:DataList RepeatDirection="Horizontal" ID="dl_Images" runat="server" OnItemDataBound="dl_Images_ItemDataBound"
OnItemCommand="dl_Images_ItemCommand">
<ItemTemplate>
<ul class="filmstrip">
<div class="panel">
<a href="" id="img_href" runat="server">
<div class="panel-overlay" align="left">
<li>
<asp:Image BorderColor="#ececec" BorderStyle="Solid" BorderWidth="1" runat="server"
ID="i_ProductImage" Width="104" Height="104" />
</li>
</a>
</div>
<div align="center" style="margin: 0px 0px 0px 0px">
<asp:LinkButton ToolTip='<%# Eval("ProductID") %>' CommandArgument='<%# Eval("ProductID") %>'
CommandName="lbclick" ID="lb_productID" runat="server" Text='<%# Eval("ProductID") %>'
CssClass="bule-link"></asp:LinkButton>
</div>
<%--<asp:Label ID="l_ProductId" runat="server" Text='<%#Eval("ProductId") %>'></asp:Label>--%>
</div>
</ul>
</ItemTemplate>
</asp:DataList>
</div>
</div>

Related

asp.net imagebutton access in listview

How can i change imageUrl in listview function. I tried some codes but not worked.
my codes
protected void DoTheCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "Button")
{
ImageButton img = (ImageButton)e.Item.FindControl("Button1");
img.ImageUrl = "/img/heartcirc.png";
html code
<asp:ListView ID="listUrunler" OnItemCommand="DoTheCommand" runat="server">
<ItemTemplate>
<div class="col-lg-3 col-md-6 mb-4 mb-lg-0">
<div class=" card-img-top rounded shadow-sm border-0">
<asp:ImageButton ID="ImageButton1" class="card-img" runat="server" ImageUrl='<%# Eval("urunResim") %>' PostBackUrl='<%# String.Format("UrunDetay.aspx?Id={0}",Eval("Id")) %>' />
<div class="card-body p-4">
<h5 class="card-title" style="margin-top: -20px"><%# Eval("urunBaslik") %></h5>
<div class="price text-success" style="justify-content: center; float: left;"><%# Eval("urunFiyat") %>TL</div>
<asp:ImageButton ID="Button1" runat="server" Width="20px" Height="20px" ImageUrl="/img/heart.png" CommandName="Button" CommandArgument='<%# Eval("Id") %>' Text="Add to Cart" />
<div style="clear: both;"></div>
</div>
</div>
</div>
</ItemTemplate>
</asp:ListView>
Thanks for helps.

Multiple grid view in multiple Tab issue

I am loading multiple grid view in multiple tab on page load ,there are 11 grid view which causing latency issue.
can you please tell me is there any another option to reduce latency, i am not able store that in session also because all the data was updating every time
<div id="tabs-1">
<div id="div_created" style="overflow-x: hidden; overflow-y: auto; height: 400px" runat="server">
<asp:GridView ID="grd_created" runat="server"
<%--*************--%>>
</asp:GridView>
</div>
</div>
<div id="tabs-2">
<div id="div_inprocess" style="overflow-x: hidden; overflow-y: auto; height: 400px" runat="server">
<asp:GridView ID="grd_inprocess" runat="server"
<%--*************--%>>
</asp:GridView>
</div>
</div>
<%--*************--%>
<%--*************--%>
<div id="tabs-11">
<div id="div1" style="overflow-x: hidden; overflow-y: auto; height: 400px" runat="server">
<asp:GridView ID="GridView1" runat="server"
<%--*************--%>>
</asp:GridView>
</div>
</div>
<ul class="tabs" data-persist="true">
<li runat="server" id="li_create" onclick="doAdelay()"><a href="#tabs-1">Created
<asp:Label ID="lblCreatedCount" runat="server"></asp:Label></a></li>
<li runat="server" id="li_proc" onclick="doAdelay()"><a href="#tabs-2">In Process
<asp:Label ID="lblInprocessCount" runat="server"></asp:Label></a></li>
<li runat="server" id="li_hold">On Hold<asp:Label ID="lblonholdCount" runat="server"></asp:Label></li>
<li runat="server" id="li_comp">Completed<asp:Label ID="lblcompltedCount" runat="server"></asp:Label></li>
<li runat="server" id="li_fianl">Finalized<asp:Label ID="lblFinalizedCount" runat="server"></asp:Label></li>
<li runat="server" id="li_custom" visible="false"><a href="#tabs-6" runat="server"
id="ViewCustom">Custom</a></li>
<li runat="server" id="li_all">All<asp:Label ID="lblAllcount" runat="server"></asp:Label></li>
<li runat="server" id="li_SrchRslt" class="clssearch" visible="false"><a href="#tabs-8" runat="server"
id="SrchRslt">Search Result<asp:Label ID="lblSearchcount" runat="server"></asp:Label></a></li>
<li runat="server" id="li_CR" visible="false">In Rebuttal<asp:Label ID="lblCodeRebuttal" runat="server"></asp:Label></li>
<li runat="server" id="li_RR" visible="false"><a href="#tabs-10" runat="server"
id="A1">Review Records<asp:Label ID="lblreviewrecords" runat="server"></asp:Label></a></li>
<li runat="server" id="li_SA" visible="false"><a href="#tabs-11" runat="server"
id="A2">
<asp:Label ID="lbltabSTA" runat="server" Text="Sent to Auditor"></asp:Label><asp:Label ID="lblSA" runat="server"></asp:Label></a></li>
<li runat="server" id="li_PRS" visible="false"><a href="#tabs-12" runat="server"
id="A3">Peer Review<asp:Label ID="lblpeerreviewS" runat="server"></asp:Label></a></li>
</ul>

asp.net - text boxes lose values entered on tab switch

I have ajax telerik tabs in my code and when I switch the tabs my controls loses whatever I have typed.
I tried "enableViewState" to true. It didn't work either.
What I want is the controls to retain values entered on tab switch
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" Width="100%" Align="Justify" >
<Tabs>
<telerik:RadTab PageViewID="RadPageView1" NavigateUrl="CreateNewUser.aspx?TabIndex=0" Text="Adviser Details" HoveredCssClass="hoveredTab" Font-Bold="true" />
<telerik:RadTab PageViewID="RadPageView2" NavigateUrl="CreateNewUser.aspx?TabIndex=1" Text="Fee Split" HoveredCssClass="hoveredTab" Font-Bold="true" />
<telerik:RadTab PageViewID="RadPageView3" NavigateUrl="CreateNewUser.aspx?TabIndex=2" Text="Signature" HoveredCssClass="hoveredTab" Font-Bold="true" />
<telerik:RadTab PageViewID="RadPageView4" NavigateUrl="CreateNewUser.aspx?TabIndex=3" Text="Reference Details" HoveredCssClass="hoveredTab" Font-Bold="true" />
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" Width="100%" RenderSelectedPageOnly="false">
<telerik:RadPageView ID="RadPageView1" runat="server" Height="100%" CssClass="RadPageViewBorder">
<div style="padding: 10px 10px 10px 10px; background-color: white;">
<uc1:AdvisorDetails ID="UCAdvisorDetails" runat="server" />
</div>
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView2" runat="server" Width="100%" Height="100%" CssClass="RadPageViewBorder">
<div style="padding: 0px 0px 0px 0px; background-color: white;">
<uc1:AdvisorFeeSplit runat="server" ID="UCAdvisorFeeSplit" />
</div>
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView3" runat="server" Width="100%" Height="100%" CssClass="RadPageViewBorder">
<div style="padding: 0px 0px 0px 0px; background-color: white;">
<uc1:AdvisorSignature ID="UCAdvisorSignature" runat="server" />
</div>
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView4" runat="server" Width="100%" Height="100%" CssClass="RadPageViewBorder">
<div style="padding: 0px 0px 0px 0px; background-color: white;">
<uc1:AdvisorReferenceDetails runat="server" ID="UCAdvisorReferenceDetails" />
</div>
</telerik:RadPageView>
</telerik:RadMultiPage>
<div class="col100" style="padding-top: 35px; padding-left: 30px; padding-right: 30px;">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="btnAddUser" ValidationGroup="vgUser" runat="server" Width="120px" Text="Save" CssClass="btn-common" OnClick="btnAddUser_Click" />
<asp:Button ID="btnDeleteUser" ValidationGroup="vgUser" runat="server" Width="120px" Text="Delete" CssClass="btn-common" OnClick="btnDeleteUser_Click"/>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnAddUser"/>
<asp:PostBackTrigger ControlID="btnDeleteUser"/>
</Triggers>
</asp:UpdatePanel>
</div>
<div class="col100">
<span class="failureNotification">
<asp:Literal ID="litError" runat="server"></asp:Literal>
</span>
<span class="successNotification">
<asp:Literal ID="litSuccess" runat="server"></asp:Literal>
</span>
</div>
Can someone point out the issue pls ?
Your tabs have NavigateUrl property set, which means they render as links, which means they redirect, they do not use ajax.
That's why the values are not persisted.

Dynamically adjust height and width of image with maintaining aspect ratio

Kindly tell me how i adjust image width and height. When i upload Image it automatically adjust in repeater according to their height and width but inside the part of repeater.
that's my code
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script src="LJCI/js/jquery-1.7.2.min.js"></script>
<script src="LJCI/js/lightbox.js"></script>
<link href="LJCI/css/lightbox.css" rel="stylesheet" />
<asp:DataList ID="GalleryDataList" runat="server" RepeatDirection="Horizontal" RepeatColumns="3" OnItemDataBound="GalleryDataList_ItemDataBound">
<ItemTemplate>
<div style="margin-left: auto;
margin-right: auto; width: 250px; margin-top: 15px; padding-left: 15px;">
<div style="border-radius:10px;height:auto; border: 1px solid #CCCCCC;box-shadow: 0 2px 4px rgba(0,0,0,0.9);">
<div class="lightbox-container">
<div class="box">
<a id="Img2" href='<%# Eval("ImgUrl").ToString().Substring(1) %>' rel="lightbox[roadtrip]" title='<%# String.Format("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9}","Arrival Date: ", Eval("ArrivalDate","{0:d}"), "<br/><br/>","Brush:", Eval("Brush"), "<br/><br/>", "Size: ", Eval("Width"), "x",Eval("Height") )%>'data-lightbox="roadtrip" data-caption="image-1" >
<asp:Image ID="Img1" runat="server" ImageUrl='<%#Eval("ImgUrl") %>' CssClass="aspectRatio" /></a>
<div class="title1 " style="text-align:left;padding-left:10px ;margin-bottom:16px;">
<asp:Label ID="lblReference" runat="server" Text='<%# Eval("Reference")%>' /><br />
Size: <asp:Label ID="lblWidth" runat="server" Text='<%# Eval("Width")%>' /> x <asp:Label ID="lblheight" runat="server" Text='<%# Eval("Height")%>' /><br/>
<asp:Label ID="lblBrush" runat="server" Text='<%# Eval("Brush")%>' /><br />
<asp:Label ID="lblDate" runat="server" Text='<%# Eval("ArrivalDate","{0:d}")%>' /><br />
<asp:Label CssClass="lblClass" ID="lblStatus" ForeColor="#B86365" runat="server" Text='<%# Eval("Sold").ToString() == "1"? "Sold" : "Available" %>' />
<br /> <br /><asp:HyperLink ID="DetailsHyperLink1" CssClass="btnClss2" ForeColor="#B86365" runat="server" NavigateUrl='<%# Eval("Id", "OrderForm.aspx?Id={0}") %>'>Enquiry</asp:HyperLink>
<br /><div class="fb-like" data-href='<%# Eval("ImgUrl", "http://#.com/Images/prod/{0}") %>'" data-width="20" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>
</div></div>
<div style="clear: both;">
</div>
</div>
</ItemTemplate>
Code output
like this i want to adjust my images according to their positions

Losing file in a file upload control in update panel c# asp.net

I have a page where I am using 3 update panels and all the update panels are working well. In one of the update panels, I have a button which on click changes label text but the problem is that on if post back happens in any of the update panels file upload loses its file.
All the update panels are used to update separate sections of page. No update panel is nested. The file upload is outside; it is not in any of the update panels but it is still losing its file.
<%# Control Language="C#" AutoEventWireup="true" CodeFile="WalkInControl.ascx.cs"
Inherits="Modules_WalkInControl" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxtoolkit" %>
<asp:Panel ID="Panel1" runat="server" Font-Size="13px" Width="670">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers ="true" UpdateMode="Conditional">
<ContentTemplate>
<div class="formfieldset" style="margin-bottom: 40px;">
<div class="formrow">
<div class="paymentfrmlabels">
Check In :</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtCheckIn" runat="server" Width="153px"></asp:TextBox>
<asp:ImageButton ID="imgbtnCalendar1" runat="server" ImageUrl="~/App_Themes/Default/images/ico-calendar.gif"
CausesValidation="false" Width="20" Height="20" />
<ajaxtoolkit:CalendarExtender ID="CalendarExtender2" runat="server" Format="dd/MM/yyyy"
TargetControlID="txtCheckIn" PopupButtonID="imgbtnCalendar1" />
</div>
<div class="paymentfrmvalidation">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="[*]"
ControlToValidate="txtCheckIn" Display="Dynamic" ValidationGroup="a"></asp:RequiredFieldValidator>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Check Out:
</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtCheckOut" runat="server" Width="153px"></asp:TextBox>
<asp:ImageButton ID="imgbtnCalendar" runat="server" ImageUrl="~/App_Themes/Default/images/ico-calendar.gif"
CausesValidation="false" ImageAlign="Top" Width="20" Height="20" />
<ajaxtoolkit:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yyyy"
TargetControlID="txtCheckOut" PopupButtonID="imgbtnCalendar" />
</div>
<div class="paymentfrmvalidation">
<asp:RequiredFieldValidator ID="valStartDate" runat="server" ErrorMessage="[*]" ControlToValidate="txtCheckOut"
Display="Dynamic" ValidationGroup="a"></asp:RequiredFieldValidator>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Room Type :
</div>
<div class="paymentfrmtxtbox">
<asp:DropDownList ID="drpRoomtype" runat="server" Width="172px" AutoPostBack="True"
OnSelectedIndexChanged="drpRoomtype_SelectedIndexChanged" AppendDataBoundItems="True">
</asp:DropDownList>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Plan :
</div>
<div class="paymentfrmtxtbox" style="height: 25px;">
<asp:DropDownList ID="drpPlan" Width="172px" AutoPostBack="True"
runat="server" onselectedindexchanged="drpPlan_SelectedIndexChanged1">
</asp:DropDownList>
</div>
</div>
<div class="formrow" style="height: 75px;">
<div class="paymentfrmlabels">
Room :
</div>
<div class="paymentfrmtxtbox">
<asp:ListBox ID="lstRooms" runat="server" Width="172px" SelectionMode="Multiple">
</asp:ListBox>
</div>
<div class="paymentfrmvalidation">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="lstRooms"
ErrorMessage="[*]" ValidationGroup="b"></asp:RequiredFieldValidator>
</div>
<div class="paymentfrmvalidation">
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<img src="../Images/loading_sm.gif" border="0" alt="">
</ProgressTemplate>
</asp:UpdateProgress>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="drpRoomtype"
ErrorMessage="[*]" ValidationGroup="a"></asp:RequiredFieldValidator>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Adults :
</div>
<div class="paymentfrmtxtbox" style="width: 50px; height: 25px;">
<asp:DropDownList ID="drpAdults" Width="50px" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="drpAdults_SelectedIndexChanged" AppendDataBoundItems="True">
</asp:DropDownList>
</div>
<div class="paymentfrmlabels" style="width: 65px;">
Children :
</div>
<div class="paymentfrmtxtbox" style="width: 50px; height: 25px;">
<asp:DropDownList ID="drpChildren" Width="50px" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="drpChildren_SelectedIndexChanged">
</asp:DropDownList>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Rate :</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtRate" Width="153px" runat="server"></asp:TextBox>
</div>
<div class="paymentfrmvalidation">
<%--<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtRate"
ErrorMessage="Invalid Format" ValidationExpression="^(-)?\d+(\.\d\d)?$" ValidationGroup="a"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtRate"
ErrorMessage="Rate Required" ValidationGroup="a"></asp:RequiredFieldValidator></div>--%>
</div>
</div> <div align="center"> <asp:Label ID="lblRoomMsg" runat="server" ForeColor="Red"></asp:Label></div>
<div class="formrow">
<div class="paymentfrmlabels">
Advance Pay:
</div>
<div class="paymentfrmtxtbox" style="height: 25px;">
<asp:TextBox ID="txtAdvance" runat="server" Width="153px">0.0</asp:TextBox>
</div>
</div>
<div class="formrow" style="text-align: right;">
<asp:LinkButton ID="lnkAdd" CssClass="btn" runat="server" Width="60px" OnClick="lnkAdd_Click1">ADD</asp:LinkButton>
</div>
<div class="formrow" style="text-align:center;">
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtCheckOut"
ControlToValidate="txtCheckIn" Operator="LessThanEqual" Type="Date" ForeColor="Red" ErrorMessage="CheckIn Must Be Before CheckOut"
Display="Dynamic" ValidationGroup="a"/>
</div>
<div class="formrow" style="height: auto; margin-top: 20px; width: 430px;">
<asp:GridView ID="gvAddedRooms" runat="server" CssClass="active-grid" AutoGenerateColumns="False"
DataKeyNames="ID" Height="18px" Width="100%" OnRowDeleting="gvAddedRooms_RowDeleting">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" />
<asp:BoundField DataField="RoomTypeX" HeaderText="RoomType" />
<asp:BoundField DataField="RoomX" HeaderText="RoomX" />
<asp:BoundField DataField="Rate" HeaderText="Rate" DataFormatString="{0:f}" />
<asp:BoundField DataField="Adults" HeaderText="Adults" />
<asp:BoundField DataField="Children" HeaderText="Children" />
<asp:CommandField ShowDeleteButton="True" />
</Columns>
</asp:GridView>
</div>
<div style="float:left;"> <asp:Label ID="Label1" runat="server" Text="Total Charge : " Font-Bold="true" ForeColor ="Blue" style="font-size:19px;"></asp:Label><asp:Label ID="lblTotalAmount" runat="server" Text=""></asp:Label>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="gvAddedRooms" />
<asp:PostBackTrigger ControlID="drpRoomtype" />
<asp:PostBackTrigger ControlID="drpPlan" />
<asp:PostBackTrigger ControlID="lnkAdd" />
<asp:PostBackTrigger ControlID="lstRooms" />
<asp:PostBackTrigger ControlID="drpAdults" />
<asp:PostBackTrigger ControlID="drpChildren" />
<asp:PostBackTrigger ControlID="btnRemoveFilename1" />
</Triggers>
</asp:UpdatePanel>
<%--<div class="formrow" style="text-align: right;">
<asp:UpdatePanel ID="UpdatePanel3" UpdateMode ="Conditional" runat="server">
<ContentTemplate >
Agency :
<asp:DropDownList ID="drpChannel" runat="server" Width="172px" AutoPostBack="True"
Height="32px" >
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="drpChannel"
/>
<asp:AsyncPostBackTrigger ControlID="lnkNewChannel" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:LinkButton ID="lnkNewChannel" runat="server" >New Channel</asp:LinkButton>
</div> --%>
<div class="newsubheadingsearchqueryresults" style="width: 685px;">
<h3>
Customer Details</h3>
<span class="requiredExample">[ * ] = Required Information</span></div>
<div class="formfieldset" style="margin-bottom: 40px;">
<div class="formrow">
<div class="paymentfrmlabels">
Paying Customer :</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtCustomerName" Width="153px" runat="server"></asp:TextBox>
</div>
<div class="paymentfrmvalidation">
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtCustomerName"
ErrorMessage="[*]" ValidationExpression="^[a-zA-Z''-'\s]{1,40}$"
ValidationGroup="a" Display="Dynamic"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtCustomerName"
ValidationGroup="a" ErrorMessage="[*]" Display="Dynamic"></asp:RequiredFieldValidator>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Customer Type :</div>
<div class="paymentfrmtxtbox">
<asp:DropDownList ID="drpCustomerType" Width="153px" runat="server">
<asp:ListItem Text="Person" Value="Person"></asp:ListItem>
<asp:ListItem Text="Company" Value="Company"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
E-Mail :
</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtEmail" Width="153px" runat="server"></asp:TextBox>
</div>
<div class="paymentfrmvalidation">
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Phone No :
</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtPhone" runat="server" Height="23px" Width="153px"></asp:TextBox>
</div>
<div class="paymentfrmvalidation">
<asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ErrorMessage="Invalid format"
Display="Dynamic" ValidationExpression="^[0-9]*$" ControlToValidate="txtPhone"
ValidationGroup="a"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtPhone"
Display="Dynamic" ValidationGroup="a" ErrorMessage="[*]"></asp:RequiredFieldValidator>
</div>
</div>
<div class="formrow" style="height: 130px;">
<div class="paymentfrmlabels">
Address:</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtAddress" runat="server" Height="129px" TextMode="MultiLine" Width="153px"></asp:TextBox>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
City :</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtCity" runat="server" Width="153px"></asp:TextBox>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Country :</div>
<div class="paymentfrmtxtbox">
<asp:DropDownList ID="drpCountry" Width="153px" runat="server">
</asp:DropDownList>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
State :</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtState" Width="153px" runat="server"></asp:TextBox>
</div>
</div>
<div class="formrow">
<div class="paymentfrmlabels">
Postal Code :</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtPostalCode" Width="153px" runat="server"></asp:TextBox>
</div>
</div>
<div class="formrow" style="height: 90px; width: 670px;">
<div class="paymentfrmlabels">
Other Guest Names :</div>
<div class="paymentfrmtxtbox" style="margin-right:45px;">
<asp:TextBox ID="txtOtherGuest" runat="server" Height="90px" Width="153px" TextMode="MultiLine"></asp:TextBox>
</div>
<div class="paymentfrmlabels">
Other Information:</div>
<div class="paymentfrmtxtbox">
<asp:TextBox ID="txtOtherInf" runat="server" Height="90px" Width="153px" TextMode="MultiLine"></asp:TextBox>
</div>
</div>
<div class="formrow" style="vertical-align: text-top;">
<div class="paymentfrmlabels">
Identity Proof :</div>
</div>
<div class="formrow">
<div class="paymentfrmtxtbox">
</div>
</div>
<div class="formrow" style="text-align: right">
<div class="paymentfrmlabels">
<input id="txtLogoFileName1" type="file" style ="float :left; z-index:999;" name="txtSmallImage1FileName" runat="server" />
<asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers ="true" UpdateMode ="Conditional">
<ContentTemplate >
<div class="paymentfrmtxtbox">
<asp:Button ID="btnRemoveFilename1" runat="server" style="margin-left:50px; float :left; z-index:999;" Text="Remove" OnClick="btnRemoveFilename1_Click">
</asp:Button>
</div>
<asp:Label ID="lblLogoFileName1" runat="server" CssClass="labelText" ForeColor="Silver"> </asp:Label>
</div>
</ContentTemplate>
<Triggers >
<asp:PostBackTrigger ControlID ="btnRemoveFilename1" />
</Triggers>
</asp:UpdatePanel>
<div class="formrow" style="width: 300px;">
<div class="paymentfrmtxtbox ">
<asp:UpdatePanel ID="UpdatePanel3" UpdateMode ="Conditional" ChildrenAsTriggers ="true" runat="server">
<ContentTemplate >
Agency:
<asp:DropDownList ID="drpChannel" runat="server" Width="153px" AutoPostBack="True"
style=" float: right; height: 28px; margin-right: 65px;width: 157px;" >
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="drpChannel"
/>
<asp:AsyncPostBackTrigger ControlID="lnkNewChannel" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:LinkButton ID="lnkNewChannel" runat="server" style="display:block; float: right;margin-right: -71px; margin-top: 16px;" >New Channel</asp:LinkButton>
</div>
</div>
</div>
<div class="formrow" style="text-align: right; font-weight:bold; color:#000;">
</div>
<div class="formrow" style="text-align: right; width: 670px;">
<asp:LinkButton ID="lnkSubmit" CssClass="btn" runat="server" OnClick="lnkSubmit_Click1"
Width="65px" ValidationGroup="a">Check In</asp:LinkButton>
<asp:LinkButton ID="lnkCheckout" CssClass="btn" Width="65px" runat="server" OnClick="lnkCheckout_Click"
ValidationGroup="a">Check Out</asp:LinkButton>
<asp:LinkButton ID="lnkCancel" CssClass="btn" Width="65px" runat="server" OnClick="lnkCancel_Click1">Cancel</asp:LinkButton>
</div>
</div>
</div>
<ajaxtoolkit:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="modalBackground" PopupControlID ="pnlChannel" TargetControlID ="lnkNewChannel" CancelControlID ="ImgBtnClose" runat="server">
</ajaxtoolkit:ModalPopupExtender>
<asp:Panel ID="pnlChannel" runat="server">
<div align="right" style ="padding-top :50px" >
<asp:ImageButton ID="ImgBtnClose" width="25px" Height ="25px" ImageUrl="~/Images/cross.png" runat="server" /></div>
<div style ="background-color:White ; border :20px; border-color:Blue;padding:20px 40px; border-radius:20px;" >
<style type="text/css">
.style1 {
width: 100%;
}
.style2
{
text-align: center;
font-weight: bold;
font-family: Andalus;
font-size: xx-large;
color: #434343;
}
.style3
{
width: 81px;
}
</style>
<div>
<table class="style1">
<tr>
<td class="style2" colspan="2">
Agency</td>
</tr>
<tr><td> </td><td> </td></tr>
<tr><td> </td><td> </td></tr>
<tr>
<td class="style3">
<asp:Label ID="lblName" runat="server" Text="Name:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtName" runat="server" Width="189px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ControlToValidate="txtName" Display="Dynamic" ErrorMessage="Mandatory Field!!!"
ForeColor="Red" ValidationGroup="acssd23"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server"
ControlToValidate="txtName" Display="Dynamic"
ErrorMessage="Invalid Name Format!!!" Font-Names="Arial" Font-Size="8pt"
ForeColor="Red" SetFocusOnError="True"
ValidationExpression="^[a-zA-Z-'.\s]{1,50}" ValidationGroup="acssd23"></asp:RegularExpressionValidator>
</td>
</tr>
<tr><td> </td><td> </td></tr>
<tr>
<td class="style3">
<asp:Label ID="lblContact" runat="server" Text="Contact:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtContact" runat="server" Width="189px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
ControlToValidate="txtContact" Display="Dynamic"
ErrorMessage="Mandatory Field!!!" ForeColor="Red"
ValidationGroup="acssd23"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtContact" Display="Dynamic"
ErrorMessage="Invalid Contact Format!!!" ForeColor="Red"
style="font-size: xx-small" ValidationExpression="^[0-9-+]*$"
ValidationGroup="acssd23"></asp:RegularExpressionValidator>
</td>
</tr>
<tr><td> </td><td> </td></tr>
<tr>
<td class="style3">
<asp:Label ID="lblAddress" runat="server" Text="Address:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtAddresss" runat="server" Height="64px" TextMode="MultiLine"
width="189px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
ControlToValidate="txtAddresss" Display="Dynamic"
ErrorMessage="Mandatory Field!!!" ForeColor="Red"
ValidationGroup="acssd23"></asp:RequiredFieldValidator>
</td>
</tr>
<tr><td> </td><td> </td></tr>
<tr>
<td class="style3">
<asp:Label ID="lblEmail" runat="server" Text="Email:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtEmails" runat="server" Width="189px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
ControlToValidate="txtEmails" Display="Dynamic"
ErrorMessage="Mandatory Field!!!" ForeColor="Red"
ValidationGroup="acssd23"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator015" runat="server"
ControlToValidate="txtEmail" ErrorMessage="Invalid Email Format!!!"
ForeColor="Red"
ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"
ValidationGroup="acssd23"></asp:RegularExpressionValidator>
</td>
</tr>
<tr><td> </td><td> </td></tr>
<tr>
<td class="style3">
<asp:Label ID="lblWebsite" runat="server" Text="Website:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtWebsite" runat="server" Width="189px"></asp:TextBox>
</td>
</tr>
<tr><td> </td><td> </td></tr>
<tr>
<td class="style3">
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td align ="right" >
<asp:Button ID="btnSubmit" CssClass="btn" Width ="140px" runat="server" Text="Submit"
onclick="btnSubmit_Click" style="height: 26px" ValidationGroup="acssd23" />
</td>
</tr>
</table>
</div>
</div>
</asp:Panel>
</asp:Panel>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="conditional">
<Triggers>
<asp:PostBackTrigger ControlID="Button1" />
</Triggers>
<ContentTemplate>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server"Text="Upload" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
The default ASP.NET FileUpload control will never work with an UpdatePanel. You need a special AsyncFileUpload control as defined in an AjaxControl Toolkit.
<ajaxToolkit:AsyncFileUpload OnClientUploadError="uploadError"
OnClientUploadComplete="uploadComplete" runat="server"
ID="AsyncFileUpload1" Width="400px" UploaderStyle="Modern"
UploadingBackColor="#CCFFFF" ThrobberID="myThrobber" />
or you can use UpdatePanel Triggers
<Triggers>
<asp:PostBackTrigger ControlID="YourControlID" />
</Triggers>
I spent all afternoon on this today, using any number of solutions I found on various forums, including this one, CodeProject.com, asp.net forums, and a whole slew of others. I tried setting Postback triggers and AsyncPostback triggers, and this late at night I can't remember what all else. None of them worked, including the one marked as the answer on this page. What I finally found was an obscure post from 2007 on the asp.net forum which, for some reason now will not load on my browser. At any rate, what finally worked for me was replacing the
<form id="form1" runat="server>
tag with this:
<form id="Form1" method="post" enctype="multipart/form-data" runat="server">
Worked beautifully.
In my case it was in the Site.Master file, but in the case of the posting on forums.asp.net, it worked in a default.aspx file.
Update: The forums.asp.net site was down, but it's back up now: UpdatePanel + FileUpload + PostBackTrigger doesn't seem to work.

Categories

Resources