Tag Info

Hot answers tagged

5

My guess for the reason you are having trouble with calling SP.UI.Status.addStatus is because the SP.js script file (which contains the namespace and relevant functions) is loaded on demand. In order to call SP.UI.Status.addStatus() as soon as the page loads, you'll need to make sure you use the script on demand framework for doing so. Something like this ...


4

The reason that it does not work is that you are overriding the Render() method. Remove that override and add the following to your CreateChildControls: this.Controls.Add(parentList); this.Controls.Add(childList); this.Controls.Add(box); If you do this then your controls will be registered in the control tree and get a valid control name. This ...


3

A webpart is a just a kind of asp.net control, nothing specific to SharePoint considering what you want to achieve.You can use javascript\jquery\ajax to add controls dynamically. With javascript\jquery, you can add HTML controls.Check this : http://techbrij.com/445/add-dynamic-form-elements-textbox-button-radio-checkbox With Ajax Updatepanel, you can add ...


2

You can use jquery Ajax pretty easily and either have the response return some more html which you can add to an element on the page or build elements based on data returned. The update panel is a simple way to implement ajax in ASP.NET but may be (depends on req) more difficult to add controls dynamically (you may end up using JS anyway.


2

Use __doPostback method on the client: __doPostback('myPostBack',''); Then, on server you should have something like this: const string myPostBackId = "myPostBack"; public override CreateChildControls() { // ... if (this.Page.Request["__EVENTTARGET"] == myPostbackId) { string textBoxValue = this.Page.Request["__EVENTARGUMENT"]; ...


2

try this code.. function ShowModal() { ExecuteOrDelayUntilScriptLoaded(function () { var options = { url: 'servername/webpart.aspx', tite: 'Add Vendor', width: 800, height: 475, allowMaximize: true, showClose: true, dialogReturnValueCallback: scallback }; ...


2

What is the real objective? As far as I know there is no easy way of, from a webpart knowing if the page (list item) has just been published or checked in. You can use the following code to check if the page is in display or edit mode and take some action: if (Microsoft.SharePoint.SPContext.Current.FormContext.FormMode == SPControlMode.Display) { // ...


2

If you want to perform postbacks from ribbon controls, there are at least two options: Use SPRibbonPostBackCommand in conjunction with implementing IPostBackEventHandler interface for your control (server-side both) Use __doPostBack in JS, and then Page.Request["__EVENTTARGET"] server-side Let me explain both approaches in detail. 1. ...


1

I think that the SPRibbonCommand return false value, thus the post back event does not invoked. To solve this issue you can create you own ribbon component. See this or this post to understand how to do this.


1

You could also create an application page which you pass the GUIDs of the selected items via a JavaScript redirect. currentsite/_layouts/AppPage?GUIDS=guid1,guid2&ReturnURL=/Pages/currentpage. Have your code complete the request then redirect to the list view via the ReturnUrl paramater.


1

Hope there is problem with the creation of the XSLT web part. I am not familiar on how you create the XSLT web part. Here i provide a procedure for creating the XSLT web part(Which i Use). 1) Add a new web part zone found in ribbon using the Sharepoint Designer 2) On Insert ribbon you can find DataView dropdown Click and add Empty Data View 3) Now You ...


1

I found my problem. One line of code in the user control page load event solved the problem: this.ID = "MyControl1"; Assigning an ID to the user control fixed it: http://bytes.com/topic/asp-net/answers/314816-dynamically-loaded-control-event-only-reached-2nd-postback The ID is always null when I checked its value on the page load


1

iv already addressed this issue here and iv taken it out and reposted it for reference How to save variables per user session per page saving session state varibles can be done using: public string Name { get { return Page.Session["SaveName"] as string; } set { Page.Session["SaveName"] = value; } } this is a ...


1

If you will post code you are using we might be able to help you properly but it happened to me when I developed a Visual WebPart in SharePoint 2007 and its properties were keeping getting default after a IIS reset so I am assuming it could be the way you are trying to save values, here's few similar solved questions see if they can help you somehow, ...


1

Actually via SharePoint designer you could start by insert a new "Custom form" (next to Data View on the Insert tab) for the list targetted. Actually there is no need to customize any of the forms, you could do this on any WIki/WebPart page. As a result you would get the default Insert view, of course, however you could start doing whatever you want with ...


1

Try this: public void LoadRibbonCustomTab(string tabId, SPRibbon ribbon) { if (ribbon == null) return; ribbon.Minimized = false; ribbon.CommandUIVisible = true; if (!ribbon.IsTabAvailable(tabId)) ribbon.MakeTabAvailable(tabId); ribbon.InitialTabId = tabId; }


1

Normally, you just include code in whatever _Click() handler you have that would be triggering the postback and let .Net handle routing it to the proper place. Is there some reason why this is not working for you? [edit] from updated question Normally, you do not load data in CreateChildControls as that is not the proper event for that. Use the _Load() ...


1

A "partial postback" is usually an AJAX interaction; you're sending a small amount of data to the server and getting some data back without sending the whole page. It makes the UX more what people are getting used to on the "modern" Web. You can use jQuery's AJAX function to make this happen.


1

You could use Javascript to sumbit the form data to your script. This way you can control what gets sent over the wires. SharePoint is ASP.Net based and that comes with its own baggage when it comes to dealing with form requests as every ASP.net page is a single form that has certain expectations about where and how it is going to be submitted/posted back. ...



Only top voted, non community-wiki answers of a minimum length are eligible