JQUERY code snippet
<html><
head><script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script><script type="text/javascript">$(document).ready(function () {$(
"#btnPost").click(function () {
var number1 = $("#txtNumber1")[0].value;
var number2 = $("#txtNumber2")[0].value;
var url = "Samples/Data/AddNumbers.aspx?Number1=" + number1 + "&Number2=" + number2;$.post(url,
function (data) {$(
"#txtResult")[0].value = data;});
});
});
</script></
head><
body><table><tr><td><span>Number1:</span></td><td><input type="text" id="txtNumber1" /></td></tr><tr><td><span>Number2:</span></td><td><input type="text" id="txtNumber2" /></td></tr><tr><td><span>Result:</span></td><td><input type="text" readonly="readonly" id="txtResult" /></td></tr></table><button id="btnPost">Add</button></
body></
html>
/* Code written in ASP.net page AddNumbers.aspx.cs file
using
System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace JQuerySamples.Samples.Data{
public partial class AddNumbers : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e){
int number1 = Convert.ToInt32(Request.QueryString["Number1"]);
int number2 = Convert.ToInt32(Request.QueryString["Number2"]);Response.Write(number1 + number2);
}
}
}
Friday, January 25, 2013
Monday, December 31, 2012
Wednesday, June 13, 2012
Calling page in div
<div class="ad">
<iframe scrolling="no" frameborder="0" allowtransparency="true" style="border:none; overflow:hidden; width:292px; height:255px;" src="http://yahoo.com">
</iframe>
</div>
<iframe scrolling="no" frameborder="0" allowtransparency="true" style="border:none; overflow:hidden; width:292px; height:255px;" src="http://yahoo.com">
</iframe>
</div>
Wednesday, June 6, 2012
Sharepoint 2010 enable Datasheet view
To enable this feature. AccessDatabaseEngine.exe needs to be installed to users machine.
Create and map new user profile properties with LDAP
We have mapped a LDAP Employee ID property with Sharepoint 2010 user profile property.
1) Create a Sharepoint user profile property (EID)
2) Check the Forefront manager for LDAP property which needs to be mapped with Sharepoint user profile property using powershell command.
- Forefront manager path.
- Drive:\Program Files\Microsoft Office Servers\14.0\Synchronization Service\UIShell)
- Click on the “Management Agents” tab
- There should be a management agent in the list that represents your synchronization connection. For Active Directory synchronization connections, the management agent will have the name MOSSAD-YourSynchConnectionName . Double click on the management agent that represents your synchronization connection
- Click on “Select Attributes”
- Select the “Show All” check box
- This should show you a list of all LDAP attributes that can be mapped to SharePoint managed properties. Remember that the $fimProperty variable in the script should have the exact same value as the attribute appears here. If the desired attribute is not in this list, the script will throw “Unable to process Put message” error.
3) Start and Stop the two services (User Profile Service and User Profile Synchronization Service
4) Run the below powershell command.
$url = http://migration:1111/ #URL of Central admin
$spsProperty = "EID" # Internal name of sharepoint user profile property
$fimProperty = "employeeID" #Name of the attribute of the LDAP
$connectionName = "User_Profile" #Name of the sharepoint synchronization connection
$site = Get-SPSite $url
$serviceContext = Get-SPServiceContext($site)
$upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)
$synchConnection = $upManager.ConnectionManager[$connectionName]
$synchConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, $spsProperty, $fimProperty)
5) If Error comes restart the server and run the above powershell command again.
Sunday, March 25, 2012
How to set sharepoint 2010 Model popup on the centre of the page
Add below style on master page for complete site.
<style>.ms-dlgContent{position:fixed}</style>
Saturday, March 24, 2012
Set Default page for the all Sites/Subsite of the Site collection.
Set Default Page for All sites inside the Sitecollection
public static void SetPageAsDefult()
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
string strUrl = "http://MYSITE:1000/sites/project/";
using (SPSite oSiteCollection = new SPSite(strUrl))
{
string sitecollection = oSiteCollection.RootWeb.Title;
if (oSiteCollection != null)
{
foreach (SPWeb web in oSiteCollection.AllWebs)
{
SPFolder rootFolder = web.RootFolder;
rootFolder.WelcomePage = "pages/Home.aspx";
web.AllowUnsafeUpdates = true;
rootFolder.Update();
web.AllowUnsafeUpdates = false;
}
}
}
});
}
public static void SetPageAsDefult()
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
string strUrl = "http://MYSITE:1000/sites/project/";
using (SPSite oSiteCollection = new SPSite(strUrl))
{
string sitecollection = oSiteCollection.RootWeb.Title;
if (oSiteCollection != null)
{
foreach (SPWeb web in oSiteCollection.AllWebs)
{
SPFolder rootFolder = web.RootFolder;
rootFolder.WelcomePage = "pages/Home.aspx";
web.AllowUnsafeUpdates = true;
rootFolder.Update();
web.AllowUnsafeUpdates = false;
}
}
}
});
}
Subscribe to:
Posts (Atom)
HTML
Script: