Using Updatepanel in sharepoint 2013 web part - sharepoint-2013

We are facing problem related to updatepanel in sharepoint 2013. we have a sample webpart that includs a label and a button, we want to write somthing to label in click event of button without refreshing the whole page. Our sample code is as followed :
<asp:UpdatePanel runat="server" ID="UpdatePanel1">
<ContentTemplate>
<asp:Label ID="lbl" runat="server" Text="Loaded" Visible="true"></asp:Label>
<asp:Button ID="btn" runat="server" OnClick="btn_Click"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
protected void btn_Click(object sender, EventArgs e)
{
lbl.Text = "BUTTON CLICKED !";
lbl.Visible = true;
}
We have tried the solution mentioned on this link but could not achieve our goal.
Any solution for this problem along with sample code will be highly appreciated.
Thanks.

As I noticed the Content Search webpart and the update panel cannot work together on SharePoint 2013 for some reason. If I add my custom update panel webpart to stand alone page than working the updapanel well.

Have you tried to play with UpdateMode and ChildrenAsTriggers? Like this for example:
<asp:UpdatePanel id="UpdatePanel1" runat="server"
UpdateMode="Conditional" ChildrenAsTriggers="true" >

Related

Changes to the code - I do not see on the site

Got a question. For example, I change the code on the page
/catalog/view/theme/nextdef/template/extension/module/latest.twig
, or rather add a handler to the button:
<i class = "fa fa-heart" onclick = "window.dataLayer = window.dataLayer || [];
dataLayer.push ({'event': 'heart'}); "> </i> </button>
But when you click on this element, there are no changes. If you look at the page code, then it is also not updated. Although I write the cache and update the Disable cache inside the browser too, and still no changes ... I would be grateful if you help. thank
The problem was that the template editor had a history of this page. And there was no code. Apparently, he referred to her. I did not know that opencart prioritizes history compared to server files.

How to add Custom Field in "summary view" of Blog on Public Site Sharepoint 2013

I am Using SharePoint 2013 Public Site not Blog Site.
According to requirement I Need to Customize Sharepoint 2013 Public Site Blog "Summary View" by showing a new custom column of video.
As Per Research i get result in Sharepoint 2010 Only not SP2013.
I also tried by doing these thing but not work :-(
1.Download Blog.xsl via SiteCollection URL/_layouts/xsl/blog.xsl.
2.Change according to the requirement Just Add xml snippet in Blog.xsl nothing else.and save CustomBlog.xsl.
3.Edit Post section Of The Blog Page.
4.Select "Summary View" and in XSL section Provide Path of CustomBlog.xsl.
<!--Start Blog for Video -->
<div class="Video">
<xsl:for-each select="$Fields">
<xsl:if test="#Name='VideoThumbnail' and not ($thisNode/#VideoThumbnail='')">
<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">:&nbsp;</xsl:text><xsl:apply-templates select="$Fields[#Name='VideoThumbnail']" mode="Computed_body"><xsl:with-param name="thisNode" select="$thisNode"/></xsl:apply-templates>
</xsl:if>
</xsl:for-each>
</div>
<!--End Blog for Video -->
Research URL:
http://sympmarc.com/2012/04/04/customizing-the-display-of-a-sharepoint-2010-blog/
Please help me out How to Customize summary view of Blog in Sharepoint 2013.
Thanks,
Satyam

How to correctly bind TextBox Text property for attached behavior?

In studying the classic article by Josh Smith, Regex Validation in WPF,
I am having an error (VS 2010) of:
Error 134 The TextBox's Text property must be bound for the RegexValidator to validate it.
This is thrown at
<TextBox
Text="{Binding Path=DateString, UpdateSourceTrigger=PropertyChanged}"
jas:RegexValidator.RegexText="{x:Static local:DateFormatRegex.DateRegex}"
jas:RegexValidator.ErrorMessage="Invalid date format."
/>
It appears to me that the text is bound. What's wrong? (I have no clue :( ).
Any help is most appreciated.
TIA
You are seeing the error because you have not set a design-time DataContext for the XAML designer to work with.
You could do this in the XAML. Add this to the UserControl/Window attributes:
xmlns:local="clr-namespace:MyProjectName.ViewModels"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d:DataContext="{d:DesignInstance Type=local:MainViewModel, IsDesignTimeCreatable=True}"
(Replace your project name, ViewModel name, etc.)
If your ViewModel does not have a parameterless constructor, you can create an instance from the code-behind of the view, e.g.:
public MyControl()
{
DataContext = new MyViewModel("a parameter");
}
Obviously this has its limitations as the application is not executing.

how to add addtional buttons by using sitecore webform for marketer

When i create a new form in sitecore by using the sitecore webform for marketer module.the form already have a default submit button , but i want to add another button like clear form function.
How could i add a new button in the form design backend?
Thanks.
I don't believe there's a built-in way to add a clear button, but you should refer to the WFFM User Guide (PDF link) on the SDN on how to use the Form Builder GUI to add fields and buttons/actions.
There's not a built-in way to add a clear button,but you may customize via jquery:
1.add a sublayout(ascx) page ,then do following
<div class="myDiv sub">
<sc:Placeholder ID="phForm" runat="server" Key="Form" />
<asp:HiddenField runat="server" ID="hfCancelButtonText" ClientIDMode="Static" />
<div class="clear"></div>
</div>
Then do following in jquery
//adding reset-button in web-forms
if ($('.scfForm .scfSubmitButtonBorder').length > 0) {
$('.myDiv .scfForm .scfSubmitButtonBorder').prepend('<input type="Reset" class="reset-button" />');
}
//adding reset-button text in My-Account web-form
var $hfCancelButtonText = $('.myDiv').find('#hfCancelButtonText').val();
$('.my-account-detail').find('.reset-button').val($hfCancelButtonText);

Create custom ItemStyle template for SharePoint

I've created a custom ItemStyle_ContactDetails.xsl for a SharePoint 2010 content query web part, which points to this custom file via the ItemXslLink property. The web part will be filtered to display only one record for that department's contact info. The list it's reading has these columns:
#Title -- built-in SharePoint column
/dsQueryResponse/Rows/Row/#WorkAddress -- built-in SharePoint column
/dsQueryResponse/Rows/Row/#PrimaryNumber -- built-in SharePoint column
#EMail -- built-in SharePoint column
#Opening_x0020_Hours -- custom multi-line rich text column
The above names are what they're called in the Data View Web Part from another site. I had the following in that DVWP that worked for a local site:
<td colspan="2" class="ms-vb" style="text-align:center">
<b><xsl:value-of select="#Title"/></b><br></br>
<div style="margin-top:10px;"><xsl:value-of
select="/dsQueryResponse/Rows/Row/#WorkAddress"/>
(MAP)
</div>
Tel: <xsl:value-of select="/dsQueryResponse/Rows/Row/#PrimaryNumber"/><br></br>
<xsl:value-of select="#EMail"/>
<p><b>Opening Hours:</b></p>
<div style="position:relative; top:0; margin:0">
<xsl:value-of select="#Opening_x0020_Hours"
disable-output-escaping="yes"/>
</div>
</td>
How do I translate this to the custom ItemStyle_ContactDetails.xsl template? The user needs to see the info without having to click a link to get to it -- it's always going to be just one record for that department. Thanks.
Some serious trial-and-error yielded the result, along with this great article: http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx
Maybe others trying this same thing can find this useful: You can edit the custom XSL file on the server via SPDesigner, but you can't do the same with the web part and hope to have the changes immediately reflected. You must export the content query web part, then edit the file in Notepad, etc., to make your changes to the following 3 items:
Change the ItemXslLink to point to your custom XSL file:
<property name="ItemXslLink" type="string">/Style Library/XSL Style Sheets/ItemStyle_ContactDetails.xsl</property>
Change the ItemStyle item in the web part to reference your template name; the template name in the XSL file is ContactDetails:
<xsl:template name="ContactDetails" match="Row[#Style='ContactDetails']" mode="itemstyle">
So in your web part, you'd have this:
<property name="ItemStyle" type="string">ContactDetails</property>
Update the CommonViewFields to list your custom columns and their types:
<property name="CommonViewFields" type="string">WorkAddress, Text; EMail,Text; Contact_x0020_Department,Choice; Map,URL; Opening_x0020_Hours,Text; PrimaryNumber, Text</property>
Save the web part file and import (upload) it via the browser to your web part gallery. Each time you make changes to the web part, you'll want to do this; the XSL file can be edited and saved in SPDesigner and the changes reflect immediately in the browser.
Hope this helps someone who gets stuck like I was :)
Whenever I edit "CommonViewFields" in the Webpart, I cannot edit the Properties after inserting the Webpart because of Correlation Error.
I am using SP 2013 onprem. Do I really need to modify the Webpart ? Isn't it enough to create a custom itemstyle.xls ?
I am playing around now for days. Each days more I have to say - Sharepoint is a mess.