how to use the updatepanl and postback trigger and progress templete in asp.net ajax - c#-4.0

hi i am using update panel in my project, one page i have file upload control is there, so save the page file upload is not working that time i used post back trigger control (id is button id) now my problem is progress bar is not working , please give me any suggestion. my code is
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:UpdatePanel ID="up1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="IBtnSave" />
<asp:PostBackTrigger ControlID="ddlAgent" />
<asp:PostBackTrigger ControlID="btnSelectCity" />
<asp:PostBackTrigger ControlID="imgBtnAgent" />
<asp:PostBackTrigger ControlID="ImgBtnCancel" />
</Triggers>
progress bar code is
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="up1"
DynamicLayout="true">
<ProgressTemplate>
<div id="Progressbar" class="Progressbar" align="center" valign="middle" runat="server">
<asp:Image ID="Image1" Width="75" Height="95" runat="server" ImageUrl="~/images/animation_processing.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
how to solve that problem, please give me any suggestion
Thank u
hemanth

i can find out the answer it is working
just write the java script like this
<script type="text/javascript">
var updateProgress = null;
function postbackButtonClick() {
updateProgress = $find("<%= UpdateProgress1.ClientID %>");
window.setTimeout("updateProgress.set_visible(true)", updateProgress.get_displayAfter());
return true;
}
</script>
after that
<asp:UpdatePanel runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="IBtnSave" />
</Triggers>
button onclick event just call that function like this
<asp:Button ID="IBtnSave" runat="server" Text="Save" CssClass="art-button"
ClientIDMode="Static" onclick="IBtnSave_Click" OnClientClick="return postbackButtonClick();"/>

Related

Hide text of search box in sharepoint

I want to hide the text of a searchtextbox, but I don't know how to do it. I'm a Sharepoint noob, so I think it is easy to do it but I don't know how... I put my code below, hope it helps:
<SharePoint:AjaxDelta ID="DeltaSiteLogo" runat="server" BlockElement="True">
<!--search-->
<SharePoint:AjaxDelta ID="DeltaPlaceHolderSearchArea" BlockElement="true" CssClass="ms-mpSearchBox ms-floatRight" runat="server">
<asp:ContentPlaceHolder ID="PlaceHolderSearchArea" runat="server">
<div id="searchInputBox">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />
<script type="text/javascript">
setTimeout(function () {
document.getElementById('SmallSearchInputBox').placeholder = 'Ex: SMS1234';
document.getElementById('SmallSearchInputBox').value = 'Ex: SMS1234';
}, 800);//time to wait for in ms
</script>
</div>
</asp:ContentPlaceHolder>
</SharePoint:AjaxDelta>
<SharePoint:SPLinkButton runat="server" CssClass="ms-siteicon-a" ID="x36d5bee949a7480783b3afc048c15598" NavigateUrl="~sitecollection/Pages/Inicio.aspx">
<SharePoint:SiteLogoImage name="onetidHeadbnnr0" runat="server" CssClass="ms-siteicon-img" ID="x74bbee6762f840edad4fe46f496d8c78" LogoImageUrl="/_layouts/15/images/siteIcon.png"></SharePoint:SiteLogoImage>
</SharePoint:SPLinkButton>
I follow this link, but this solution didn't work for me and It doesn't change the text of the textbox:
Can anyone help me? Thanks a lot!
The control ID will change as page inherit, for example:
Try to use jQuery regex selector, for example:
$('div[id*="SmallSearchInputBox"]')

Ext.Net - Change panel width from Javascript

I would like to change panel width size from javascript.
Here my code but don't work:
Javascript code:
<script type="text/javascript">
var ExtraExpandMAP = function (pannello) {
pannello.setWidth = 920;
};
</script>
Asp.Net code:
<ext:Panel ID="PanelLazyMAP" runat="server"
Region="East"
Width="460"
Title="Mappa"
Layout="Fit"
Floatable="false"
Resizable="true"
Collapsed="true"
Collapsible="true"
AutoScroll="false"
BodyStyle="background-color:#ffffff;"
MarginSpec="84 0 0 0" AnimCollapse ="false">
<HeaderConfig>
<Items>
<ext:Button ID="btnExpandExtraMAP" runat="server" Icon="RewindGreen">
<Listeners>
<Click Handler="ExtraExpandMAP(#{PanelLazyMAP});">
</Click>
</Listeners>
</ext:Button>
</Items>
</HeaderConfig>
</ext:Panel>
The problem is:
pannello.setWidth = 920;
instead of:
pannello.setWidth(920);

Kentico cms:FormSubmit localization and layout html

I've created a Form, with the following layout:
<fieldset class="form-group subject">
<legend>Subject</legend>
<cms:FormLabel runat="server" ID="lTextBoxControl" Field="TextBoxControl" /><cms:FormErrorLabel runat="server" ID="eTextBoxControl" Field="TextBoxControl" />
<cms:FormControl runat="server" ID="iTextBoxControl" Field="TextBoxControl" FormControlName="TextBoxControl" CssClass="" />
</fieldset>
<fieldset class="form-group message">
<legend>Message</legend>
<cms:FormLabel runat="server" ID="labelMessage" Field="TextAreaControl" /><cms:FormErrorLabel runat="server" ID="messageError" Field="TextAreaControl" />
<cms:FormControl runat="server" ID="iTextAreaControl" Field="TextAreaControl" FormControlName="TextAreaControl" CssClass="" />
</fieldset>
<cms:FormSubmit runat="server" ID="fSubmit" />
I have a localization string for the button label, but can't get that work. Also, when this rendors, it's wrapped in a TABLE tag which is a big issue too.
I can't see anything in the V9 documentation for this control either.
A little more digging and i came up with this : http://devnet.kentico.com/questions/custom-submit-button-text
Forms > General > Submit Button Text
I then used my localization string.

master-pages SharePoint2010- Show content

I have created a new master page to SharePoint 2010. Right now I'm just trying to make it work. I want to display who modified the page and when. This works great whit this code:
<SharePointWebControls:DateTimeField FieldName="Modified" runat="server" ControlMode="Display"/>
by
<SharePointWebControls:UserField FieldName="Modified By" runat="server" ControlMode="Display"/>
But my problem is that when i Load the SP-page with my master-Page this part of the page stays for 0.5 seconds and then disappears. My question is: Do you know how I can make the modified and modified by content to stay on my site?
Thanks for your help!
The Answer to my Question was that I had to put the cod from the question before this tag:
<asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">
so my finished cod looks like this:
<!-- Footer with Last modified/modified by and date of the day -->
<div class="s4-notdlg" style="clear:both; background-color:white; padding:10px; margin-left:160px;">
<div class="hide">
<div>
Idag är det
<script type="text/javascript">
var date = new Date();
document.write(date.toLocaleDateString());
</script>
</div>
Senast uppdaterat:
<SharePointWebControls:DateTimeField ID="DateTimeField1" FieldName="Modified" runat="server" ControlMode="Display"/> av
<SharePointWebControls:UserField ID="UserField1" FieldName="Modified By" runat="server" ControlMode="Display"/>
</div>
</div>
<SharePoint:DeveloperDashboard ID="DeveloperDashboard1" runat="server"/>
</div>

submit whole form to webservice

I am using webservice.I wanna sumbit my form elements to the webservice,in your example ,it is possiable send parameterrs by one by.is there any way to submit whole form and parse it and reach serverside part.
<ext:Button ID="Button1" runat="server" Text="XML WebMethod">
<Listeners>
<Click Handler="xmlService(#{txtName}.getValue());" />
</Listeners>
</ext:Button>
var xmlService = function (name) {
Ext.net.DirectMethod.request({
url : "XmlService.asmx/SayHello",
cleanRequest : true,
params : {
name : name
},
success : function (result) {
Ext.Msg.alert("Xml Message", Ext.DomQuery.selectValue("string", result, ""));
}
});
};
or using eventhandler
<ext:Button runat="server" Text="[WebMethod]">
<DirectEvents>
<Click
Url="TestService.asmx/SayHello1"
Type="Load"
Method="POST"
CleanRequest="true">
<ExtraParams>
<ext:Parameter Name="name" Value="#{txtName}.getValue()" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
Assume there is the following form on the page.
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:TextField ID="TextField1" runat="server" />
<ext:TextField ID="TextField2" runat="server" />
</form>
A DirectMethod call with a form submit.
Ext.net.DirectMethod.request({
url : "XmlService.asmx/Submit",
formId : "form1"
});
A DirectEvent call with a form submit.
<DirectEvents>
<Click Url="XmlService.asmx/Submit" />
</DirectEvents>
A Submit WebMethod
[WebMethod]
public object Submit(string TextField1, string TextField2)
{
// some stuff
}

Resources