Monday, June 21, 2010

Microsoft.SharePoint.WebPartPages.ToolPart , page needs a refresh to apply changes back to web part

Hi

 

I have a problem with custom tool part. The page needs a refresh before the changes are actually visible in the web part.

Either user have to hit apply then OK in Tool Part, or after directly hitting Ok he needs to refresh the page.

 

Seems to be create child control of web part  being called before applychanges of tool part.

 

Any pointers ?

Reply 1

This is a common issue with custom properties in SharePoint webpart.

Just try call the method that modifies your custom property in the PreRender event.

For more check these links:

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/6445d939-05da-4ce9-a2cf-3e9fe28b98ee

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/5b85a5dc-37aa-49d7-a741-d40c7bd2bd0c




BR, PM

Reply 2

Hi

 

Thanks for you guidance,

I had to use a property from custom tool part to a script in the usercontrol( inside our web part).

calling my RegisterStartUpScript inside OnPreRender in user control solved my problem.

 

Thanks

Reply 3

Awesome news!!




BR, PM

 

Friday, June 11, 2010

How can i find the currently login user of extended web application through ASP.Net code?

i have created a web application http://spserver:19578 and then i extend a web application http://spserver:19579 from it.

Now i am currently login as ali to http://spserver:19579. i write the following code

SPSite sitecollection = new SPSite("http://spserver:19579");
SPWeb web = sitecollection.AllWebs["/"];
SPUser user = web.CurrentUser;

lblUser.Text = user.Name;

but it returns System Account. and when i used LoginName instead of Name then it returns SharePoint\system.

 

Note: I am using form based authentication in http://spserver:19579 and windows authentication in http://spserver:19578.

 

Reply 1

hey try using SPContext .Current .Web .CurrentUser

thumbnail word, pdf, excel etc in wss 3.0

does anyone know of a way to create thumbnails for documents in sharepoint services?  what i would like to happen is provide a new column that would allow the end user to hover a icon that would provide a 200X200 popup thumbnail.  this would give my endusers a quick look at the doc with out having to open.

i tried this link but can't get it to work.  it's date for 2005
http://msdn.microsoft.com/en-us/library/aa289172(VS.71).aspx

thanks for any help

reply 1

use aspose pdf kit