Posted on 28/05/2015 12:34:25
Hi Imar,
Yes, I have followed your post to create User Controls on the website. The funny thing is that the User Control works locally on my machine but when I embed it to the template as a User Control on the website, it doesn't seem to work.
Very strange.
Here is the ascx code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Search.ascx.cs" Inherits="Search" Debug="true" %>
<form runat="server">
<asp:ScriptManager EnablePartialRendering="true" ID="ScriptManager1" runat="server"></asp:ScriptManager>
<%-- <script type="text/javascript" lange="javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args){
if (args.get_error() != undefined){
args.set_errorHandled(true);
}
}
</script>--%>
<div class="clearfix logo">
<div class="container">
<a href="/"><img class="hide-on-scroll-50 no-mobile" src="/Files/Templates/Designs/Condition/assets/images/design/nst-logo-banner.png" /></a>
</div>
</div>
<!--Filter-->
<asp:Label ID="errorLbl" runat="server"></asp:Label>
<div class="tour-filter inactive col col-width-10">
<h4 class="no-mobile">Filter your search - <span>please select one or more search criteria and click update</span></h4>
<div class="columns">
<asp:UpdatePanel ID="subjectUpdatePanel" runat="server">
<ContentTemplate>
<asp:PlaceHolder ID="searchUpdateFilter" runat="server">
<div class="col col-width-2">
<div class="range-slider box price">
<label for="amount" class="style-as-paragraph">Price per person:</label>
<div class="slider"></div>
<input type="text" class="slider-field" id="amount" name="amount" readonly>
</div>
</div>
<div class="col col-width-2">
<div class="form-input select">
<!-- <label for="subject" class="style-as-paragraph">Subject</label> -->
<div class="field">
<asp:DropDownList ID="subjectDD" runat="server" AutoPostBack="true" OnSelectedIndexChanged="subjectDD_SelectedIndexChanged" Enabled="true">
<asp:ListItem Text="Subject" Value="Subject"/>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col col-width-2">
<div class="form-input select">
<!-- <label for="country" class="style-as-paragraph">Country</label> -->
<div class="field">
<asp:DropDownList ID="countryDD" runat="server" EnableViewState="true">
<asp:ListItem Text="Country" Value="Country"/>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col col-width-2">
<div class="form-input select">
<!-- <label for="location" class="style-as-paragraph">Location</label> -->
<div class="field">
<asp:DropDownList ID="destinationDD" runat="server">
<asp:ListItem Text="Destination" Value="Destination"/>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col col-width-2">
<div class="form-input select">
<!-- <label for="audience" class="style-as-paragraph">Audience</label> -->
<div class="field">
<asp:DropDownList ID="schoolDD" runat="server">
<asp:ListItem Text="School type" Value="School type"/>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col col-width-2">
<!-- temporary override in main.js -->
<div class="form-input submit">
<input type="submit" value="Update">
</div>
</div>
</asp:PlaceHolder>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="subjectDD" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</form>
If you could please help me with this, that would be great!
Thanks!