Jun 8, 2009

Using SharePoint Controls with Power WebPart

SharePoint comes with a bunch of custom ASP.NET Controls. For sure you can use them with Power WebPart.
This example shows how you can search for list items by title containing a specified search string and display the result in a SharePoint list view, featuring the SharePoint ListViewByQuery control.
image

The Script

$textBox = New-Object System.Web.UI.WebControls.TextBox;
$button = New-Object System.Web.UI.WebControls.Button;
$button.Text = "Search"
$listView = New-Object Microsoft.SharePoint.WebControls.ListViewByQuery;
$br = New-Object System.Web.UI.WebControls.WebControl([System.Web.UI.HtmlTextWriterTag]::Br)

function createchildcontrols($controls)
{
$controls.Add($textBox)
$controls.Add($button)
$controls.Add($br)
$controls.Add($listView)
}

function onprerender()
{
# Parameter 1 can be configured in the webpart editor
$listTitle = $webpart.Parameter1

$list = $web.Lists[$listTitle]
$listView.List = $list;
$query = New-Object Microsoft.SharePoint.SPQuery -ArgumentList $list.DefaultView;

$query.Query = "
                                 


$($textBox.Text)

"

$listView.Query = $query
$listView.DisableFilter = $true
$listView.DisableSort = $true 
}

function onerror($writer)
{
$writer.Write("List title is not configured or the list does not exist.")
}

16 comments:

Anonymous said...

I love you man!!!!!

Anonymous said...

Any chanel replica handbags Provider prides again to generatte that will be a fact into the Japanese heritage for superior together with a long life. Shop for together with dress in some sort of Wives Semi-automatic or fully automatic with confidence together with ego. Diver pieces provides a watch for every last affair and likewise which really can be damaged for the affair. Go with amongst even more Wives Semi-automatic or fully automatic you may breitling replica watches break! Any Semi-automatic or fully automatic Diver 300M tumbles during the category of reasonable pieces within the world famous type. It all could be described as a nicely dependable which unfortunately incorporates a ebony switch together with luminous control. Any precious metal shade markers on this subject harmonize with any chrome steel condition together with accessory. Any a couple of times more clasp over the chanel replica tote bags sporting events a good 2 bottle health and safety shut which really can be conveniently revealed by using a touch link. Condition size just like the queen's is certainly 34 mm and also is certainly water-repellent as many as hublot replica watches making it feel like made for on a daily basis take advantage of. For example people outlined early, the having a no-nonsense appearance has got extremely a low priced $150 price level.

邓洁 said...

Typically the Hermes Berkin pouch given the name when the delightful actress Jane Berkin had become a hit when ever it's louis vuitton replica sale produced. But not just will be pouch chic not to mention graceful to sling, jointly maintain a pool of designate from a marvelous actress affiliated with it again, that makes it by far the most coveted purses through we all. Typically the pouch fabricated from with the help of a considerable amount of incredible fabrics, it needs near forty eight numerous hours towards chanel replica bags solely build a particular section. This is the reason for what reason families found some primed length of up to one year as soon as pouch was initially produced, and then the call for regarding it was basically which means big. Certainly no surprise, typically the pouch is extremely predominantly valued who in no way every one of us will be able it again. Up to the point big day, this unique pouch might be noticed in your wrists and hands from people involved especially unique, not to mention sourced from typically the top dogs chapters of typically the the community. Anyone online can perhaps even check out a considerable amount of widely used people shapes along the lines of replica chanel performers not to mention sportswomen using this unique pouch. And yet, that will not suggest that we tend to give up aiming for this unique pouch for the most part. For everybody who is the often most successful partner, not to mention if you prefer typically the pouch according to any sort of problems, therefore you want to discover numerous vary options as a way to have this ideal trendy pouch. Not to mention states it all will have it happens to be from investing in second-hand Hermes Berkin pouch. There are a number from ınternet sites on line whereby most females get single members distribute his or her's out of date trendy items.

digital signature sharepoint said...

Excellent! Thanks for this - I've been looking at this feature for ages. Followed your instructions and it works a treat!

Hug Day said...

happy hug day 2016
happy hug day 2016 Date SMS Messages Quotes
How Hug Day Is Celebrated
Happy hug day sms

dongdong said...

stephen curry shoes
canada goose jackets
michael kors outlet
michael kors uk
nike tn
babyliss flat iron
michael kors outlet
michael kors watches
coach outlet
polo ralph lauren outlet
michael kors outlet online
oakley sunglasses
reebok
nike air max
coach outlet online
coach outlet
burberry outlet
christian louboutin uk
reebok uk
michael kors outlet
coach factory outlet
christian louboutin uk
hermes belt
hollister co
versace
cartier glasses
pandora jewelry
fitflops shoes
louis vuitton outlet online
oakley store
valentino store
hollister sale
canada goose uk
coach outlet online
louis vuitton outlet
jordans shoes
coach outlet
kate spade outlet
toms shoes
armani exchange
20163.22wengdongdong

风骚达哥 said...

20160423 junda
air jordans
cheap oakley sunglasses
kate spade outlet
adidas stan smith
ray ban sunglasses
michael kors outlet
nike air max shoes
cheap omega watches
yeezy boost 350
michael kors outlet online
michael kors outlet online
nike free runs
air jordan uk
michael kors outlet online
pandora charms
ray ban outlet
calvin klein outlet
fitflops sale clearance
toms outlet
nike huarache white
sac longchamp
toms outlet
michael kors outlet clearance
bottega veneta outlet
armani watches
gucci handbags
nike blazer
oakley sunglasses
true religion jeans
cheap jordans
ray bans
hollister
bottega veneta handbags
jimmy choo outlet
oakley sunglasses
converse
prada outlet
reebok shoes
true religion
burberry outlet

Libin Huang said...

20160426libinhollister clothing store
oakley sunglasses
michael kors handbags
tiffany outlet
ray-ban sunglasses
gucci outlet online
ray-ban sunglasses
burberry outlet online
coach outlet canada
ray-ban sunglasses
herve leger outlet
ray ban sunglasses sale
air max 90
oakley sunglasses
adidas wings shoes
michael kors outlet
michael kors factory outlet
louis vuitton bags
michael kors online outlet
nba jerseys
ralph lauren pas cher
oakley sunglasses
toms shoes
nike air max 90
nike tn pas cher
air max 90
lululemon outlet
nike air force 1
true religion outlet
michael kors outlet
burberry outlet store
ray ban sunglasses
kobe shoes
true religion outlet
discount michael kors handbags

Yuanyuan Lin said...

7.14llllllyuan"hollister shirts"
"true religion canada"
"true religion outlet"
"beats by dre"
"nike tn pas cher"
"ray ban sunglasses"
"tory burch outlet"
"mulberry handbags"
"prada outlet"
"michael kors outlet"
"tiffany outlet"
"louis vuitton neverfull"
"louis vuitton handbags"
"giuseppe zanotti shoes"
"nike uk store"
"michael kors wholesale"
"tiffany jewelry"
"michael kors outlet"
"ralph lauren pas cher"
"mulberry bags"
"nike air force 1"
"police sunglasses for men"
"gucci outlet online"
"ray ban sunglasses"
"jordan shoes"
"asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano"
"cheap jordan shoes"
"basketball shoes"
"fitflops sale"
"prada outlet online"
"ralph lauren polo"
"nike air max 90"
"omega outlet"
"lacoste shirts"
"longchamp outlet"
7.14

Fangyaya said...

louis vuitton handbags
tory burch shoes
adidas trainers
christian louboutin sneakers
nike roshe flyknit
louis vuitton handbags
toms wedges
concord 11
asics shoes for women
oakley outlet
coach outlet
adidas shoes
basketball shoes
michael kors outlet
michael kors outlet
christian louboutin outlet
michael kors outlet
jordan shoes
kate spade outlet
coach outlet online
coach outlet store
beats by dre
oakley vault
celine outlet
michael kors outlet online
ray ban sunglasses outlet
jordan concords
michael kors outlet online
gucci outlet online
christian louboutin sale
toms wedges
abercrombie clothing
michael kors outlet online
toms outlet
rolex watches
red bottom shoes
celine handbags
michael kors outlet online
abercrombie & fitch outlet
louis vuitton purses
20168.8chenjinyan

Justin said...

By submitting to an understudy credit combination arrange, an understudy has an opportunity to excel. The time taking after graduation, whether an understudy has completed his or her training or expects to proceed to master's level college, is an immense transitional period. cash advance san-diego

marko said...

Initially it was raising the financing cost, now understudy advances upheld by the government are changing how they credit out the cash. The old understudy credit program, the Federal Family Education Loan Program (FFELP) obliged understudies to acquire cash from a real bank, and the bank was repaid from the government. Cash Advance Chicago

Paulo said...

This year, it is trusted that understudies will be getting something like $11,000 all things considered to help them manage rising educational cost costs and falling understudy help. Payday Loans Chicago

dada24 Xu said...

ugg outlet
christian louboutin shoes
ray ban sunglasses
birkenstock sandals
oakley sunglasses
ralph lauren outlet online
coach outlet
oakley sunglasses outlet
kate spade
ugg boots
2061921caiyan

John said...

air force 1
birkenstock outlet
ugg sale
fitflops sale
michael kors outlet store
canada goose jackets
nike uk
converse all star
ralph lauren outlet online
coach outlet online
birkenstock outlet
abercrombie
polo ralph lauren outlet
adidas nmd r1
mcm outlet online
coach outlet online
timberland boots outlet
ed hardy store
true religion jeans outlet
nike cortez classic
timberland shoes
louis vuitton outlet online
birkenstock sale
louboutin outlet
michael kors handbags outlet
uggs sale
birkin handbags
rolex watches for sale
michael kors outlet store
vans outlet
polo ralph lauren outlet online
20161102yuanyuan

Meiqing Xu said...

michael kors outlet
michael kors outlet
chaussures louboutin
michael kors outlet
cheap jordans
coach factory outlet
rolex watches
ray ban eyeglasses
ugg boots
pandora jewelry
20161221caiyan