Hello. I have an user control and i want to use it twice on same page. This is the UC.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ImageManagerCtrl.ascx.cs"
Inherits="SitefinityWebApp.Application.Backend.Controls.ImageManagerCtrl" %>
<script type="text/javascript">
function cellSelected(sender, args) {
var mediaUrl = args.get_gridDataItem().getDataKeyValue("MediaUrl");
document.getElementById("<% =hdnMediaUrl.ClientID %>").value = mediaUrl;
}
function cellDeselected(sender, args) {
var mediaUrl = args.get_gridDataItem().getDataKeyValue("MediaUrl");
document.getElementById("<% =hdnMediaUrl.ClientID %>").value = '';
}
</script>
<asp:Panel runat="server" ID="pnlMedia">
<asp:HiddenField runat="server" ID="hdnMediaUrl" ClientIDMode="Static" />
<asp:DropDownList ID="lstAlbums" runat="server" Width="100%" OnSelectedIndexChanged="lstAlbums_SelectedIndexChanged"
AutoPostBack="True" />
<br />
<telerik:RadGrid ID="grdPhotos" runat="server" GridLines="None" Skin="Sitefinity"
OnItemDataBound="grdPhotos_ItemDataBound">
<MasterTableView CssClass="listItems" AutoGenerateColumns="false" DataKeyNames="Id, MediaUrl"
ClientDataKeyNames="Id, MediaUrl">
<Columns>
bla bla bla
</Columns>
</MasterTableView>
</telerik:RadGrid>
</asp:Panel>
And here is the page where i need.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Edit.ascx.cs" Inherits="SitefinityWebApp.Application.Backend.Affinia.Slides.Edit" %>
<%@ Register TagPrefix="uc" Src="../../Controls/ImageManagerCtrl.ascx" TagName="ImageManagerCtrl" %>
<asp:HiddenField ID="hdnItemId" runat="server" />
<fieldset class="sfNewContentForm agnesianContentForm">
<ul>
<li class="sfFormSeparator">
<uc:ImageManagerCtrl ID="imageManagerBackground" runat="server" />
</li>
<li class="sfFormSeparator">
<uc:ImageManagerCtrl ID="imageManagerForeground" runat="server" />
</li>
</ul>
</fieldset>
I need in the second form the address for one image clicked in the first user control and one from the second user control. The address is stored in the hidden field and is returned with if(!string.IsNullOrEmpty(hdnMediaUrl.Value)) return hdnMediaUrl.Value; from code behind.
My problem is that only the second ImageManager works. The second one, when is clicked, run as the first one. I found that usint alert( "<%=this.ClientID%>"); in cellSelected function. Everytime it show foreground's user control id.
I tryed to change ClientIdMode, tryed everithing i know to do. Something interesting is that if i change the position of user controls, the second one is used too. Is like i have just one of them.
I spent hours trying to solve this problem and no help.
Thanks for you help.
Point btnpos =
new
Point(itemButton.Location.X,itemButton.Location.Y);
PanelOfEachGroup.VerticalScrollbar.PerformScrollTo(btnpos);
PanelOfEachGroup.ScrollControlIntoView(btnpos);
Hello All,
I am using Sitefinity 5.1.
I have a project with there is main site and also prepare separate Mobile site for different Smartphone and tablets.
I have created rules and also I have set up that root of that Mobile site in this.
Main site: www.mysite.com
Mobile site: www.mysite.com/mobile
So when I have testing with smart phones and a tablet it takes to me with Mobile site
but the problem is when I have test with desktop or Notebook it redirect to me on mobile site. It should take to on Main site.
SO how can I do with this open default site like www.mysite.com on desktop or Notebook and www.mysite.com/mobile on smart phones and tablets?
Its urgent please replays me ASAP.
Thanks In Advance!!!
Jignesh Gohil
Hi,
I'm writing a demo app that has a split container with a left panel that contains a tree, which is used for navigation, and a centre panel.
When a user selects a node on the tree the corresponding User Control is then displayed on the centre panel.
What I would like to do is add some animation to the User Control so that it slides in / out of the centre panel.
Is this possible?
I got this idea from your DemoHub App, but instead of using the RadPanorama control I would like to use the SplitContaining.
I suppose the overall goal is to produce a smooth loading of the UserControl, just now it's a bit jumpy, so if it was animated the overall experience might be improved.
Cheers
Shaun
private
void
GenerateConfigurationSummary(RadGridView display)
{
const
string
colValue =
"value"
;
const
string
colHeader =
"header"
;
display.HideSelection =
true
;
display.Rows.Clear();
display.Columns.Clear();
display.Columns.Add(colHeader);
display.Columns.Add(colValue);
display.ReadOnly =
true
;
display.ShowColumnHeaders =
false
;
display.ShowRowHeaderColumn =
false
;
display.TableElement.DrawBorder =
false
;
display.CellFormatting += (s, e) =>
{
if
(e.Column.Name == colHeader)
e.CellElement.Font =
new
System.Drawing.Font(e.CellElement.Font, System.Drawing.FontStyle.Bold);
e.CellElement.DrawBorder =
false
;
};
try
{
display.Rows.Add(
"Test Row 1"
,
"Test Value 1"
);
display.Rows.Add(
"Test Row 2"
,
"Test Value larger line goes here"
);
display.Rows.Add(
"Test Row 3"
,
"Test Value 1"
);
foreach
(var col
in
display.Columns)
col.BestFit();
}
catch
(Exception ex)
{
System.Diagnostics.Debug.WriteLine(
"Error Formatting Display: "
+ ex.ToString());
}
}