Visual Web Part Value not Selecting in Page Redirection

 Hi..
 I have a Visual Web Part having DropDown Controls and adding Webpart in 3 Web Part Pages .. When we redirect from 1 page to another, the  selected dropdown values are not coming in 2nd and 3rd page..
Ravindranath

You have added visual web part in three different pages, drop down value will not be selected when you redirect to page 2 or page 3 because they are separate pages and a separate web parts added on each page. Each page has a separate page life cycle.
You can only set dropdown value by passing query string parameter.
Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

Similar Messages

  • How to develop a solution for news web part to not cut off words when displayed on a page?

    Hello,
    I am not sure where to turn to, but I have a web part on a SharePoint 2013 page where it displays news and announcement items.  4 lines of text are displayed, but words are cut off.  For example:
    The day was grey and stormy in the middl...
    Read More
    Is there a way to not have SharePoint cut off words and display the whole word before it adds the ... and the end of text?
    Is there a third party web part that does a better job at displaying news?
    Thanks,
    Paul
    Paul

    i think your code is such way it hides remaining text anyways try these links as reference:
    http://veroniquepalmer.com/2011/04/23/announcements-gotchas-on-sharepoint-2010-site-pages/
    http://sharepoint.stackexchange.com/questions/20959/sharepoint-2010-set-character-limit-of-news-webpart-without-sp-designer
    http://sharepointsolutions.blogspot.in/2009/02/expanding-size-of-announcements-web.html
    http://www.edugeek.net/forums/virtual-learning-platforms/31539-customizing-announcements-summary-view-sharepoint.html
    Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing

  • Create a Site Definition file with Visual Web part in Visual Studio

    I tried to create a site definition file in Visual Studio 2013 and SharePoint 2013 by following the MSDN tutorial:
    Walkthrough: Create a Basic Site Definition Project. Near the end, I added a virtual web part control to the site definition and registered MyWebPartControls in the site definition's default ASPX page as written in the MSDN tutorial:
    Unfortunately, IntelliSense doesn't show any MyWebPartControls: tags, and VisualWebPart1 is highlighted with a warning “Element 'SMWebPart3' is not a known element. This can
    occur if there is a compilation error in the Web site, or the web.config file is missing.”
    Since it’s a warning, I went ahead to build and deploy the solution. However, when I used the site definition template to create a subsite, it returned a parser error:
    Unknown server tag 'MyWebPartControls:TestSiteDef1.VisualWebPart1'
    I spent half day researching and debugging, and finally solved the problem. The issue is on the registration line:
    <%@ Register Tagprefix="MyWebPartControls" Namespace="TestSiteDef.VisualWebPart1" Assembly="$SharePoint.Project.AssemblyFullName$" %>
    The $SharePoint.Project.AssemblyFullName$ is a replaceable parameter to provide values for SharePoint solution items whose actual values are not known at design time. Unfortunately, it does not find the right assembly name during the deployment. It should
    be replaced by the Assembly’s Strong Name. Here is how I fixed the problem step by step:
    In Solution Explorer, open the package node and double click Package.package
    Click Manifest tab in the Package.package.
    Copy the full assembly name in the package’s manifest. It may be similar like this:
              Assembly="TestSiteDef,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    Back to the site definition’s default.aspx page, replace the
                     Assembly="$SharePoint.Project.AssemblyFullName"
    in the registration line with the copied text:
    Assembly="TestSiteDef,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    Change the Namespace from
    Namespace="TestSiteDef.VisualWebPart1"
    to
    Namespace="TestSiteDef".
    The line to register the web part in a site definition file will look like this:
    <%@
    Register
    Tagprefix="MyWebPartControls"
    Namespace="TestSiteDef "
    Assembly="TestSiteDef, Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    %>
    Clean, build and deploy the solution. It works like charm. (Note: the warning message on visual web part may still exist, but you can ignore it).

    Assuming your .ascx.vb file is inheriting from the web part class, you can add the custom properties in the same manor (language syntax aside).
    Be sure to use the attributes to correctly identify and scope the properties. (see:
    http://www.sbrickey.com/Tech/Blog/Post/SharePoint_Attributes_for_Web_Part_properties)
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com

  • Access denied error while adding visual web part

    i am trying to create visual web part using client side code in SharePoint 2013.
    i am able to deploy my web part but when I try to add it on a page it says " Access denied. You do not have permission to perform this action or access this resource" and when i try to debug it it shows exception: "The remote server returned
    an error: (500) Internal Server Error."
    Following is the code:
     protected void Page_Load(object sender, EventArgs e)
                var ClientContext = new ClientContext("http://172.20.30.100:1111/");
                        //SP.ClientContext.get_current();
                Web web = ClientContext.Web;
                ClientContext.Load<Web>(web);
                ClientContext.ExecuteQuery();
                var BU = web.Title;
                ListCollection ListColl = web.Lists;
                List list = ListColl.GetByTitle("LNT_Testimonial");
                CamlQuery CmlQry = new CamlQuery();
                CmlQry.ViewXml = @"<View>
                                        <Query>
                                          <Where>
                                            <Eq>
                                              <FieldRef Name='BU' />
                                              <Value Type='Text'>" + BU + @"</Value>
                                            </Eq>
                                          </Where>
                                        </Query>
                                        <RowLimit>1</RowLimit>
                                      </View>";
                Microsoft.SharePoint.Client.ListItemCollection items = list.GetItems(CmlQry);
                ClientContext.Load<ListCollection>(ListColl);
                ClientContext.Load<List>(list);
                ClientContext.Load<Microsoft.SharePoint.Client.ListItemCollection>(items);
                ClientContext.ExecuteQuery();
                //var testimonial = items.FieldValues["testimonial"];
                foreach (Microsoft.SharePoint.Client.ListItem item in items)
                    var testimonial = item.FieldValues["testimonial"];
    regards, Ritesh Anand

    I'm not sure if you are trying to create visual webpart or doing something else? As I understand from your code, maybe, you are trying to access list item. If you have access to the server (on-premise), you can check the ULS log for details of the error.
    Is it access denied or 'internal server errror'. If it's internal server error then more details can be found in SharePoint ULS log. About reporting service, not sure if it's related to your original question. Please try to use a single post to focus on single
    problem.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Reporting Services Webpart - web part does not auto render consistantly

    We are on SharePoint 2010 (integrated with Reporting Services)- on several sites we have added the Reporting Services Web Part and with a saved parameter.  The behavior of this web part is not consistent.  There are times when I open up a site
    and the web part will auto render the report.  5 minutes later I can go into the same site, and the web part does not auto render the report.  I have to do edit page, or close and re-open the web site.  Has anyone experienced this type of behavior. 
    I've looked for assistance with this issue on-line cannot find anything that specifically addresses this issue.   

    Hi Karen,
    If the parameters have default values in the report, then the report can be rendered automatically.
    For this issue, I recommend to verify the things below:
    Does this issue occur when you open the page with the web part in a new tab in the browser or go back to the previous opened tab?
    Does this issue occur in the server side or client side?
    Please add the site to trusted sites in Internet Explorer to see how it works.
    Please change another browser to see how it works.
    For narrowing down the issue scope, please test with another report and compare the results.
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to display alert message box in sharepoint 2013 visual web part?

    Hi,
    I am developing a visual web part which submits data to the list. Once it submits the data, I should convey to the user that the data has been submitted successfully.
    I tried using clientScript.RegisterStartUpScript etc, but, none of them are working. It is not throwing any error , but pop up is not getting displayed.
    Preferrably, I would like to call this alert message from cs page, because, I will be using it in several places.
    Please help me.!
    Thanks in advance.
    Hepsi

    Hepsi, 
    Step 1. On the Page_Load - This way you can pass parameters. Try this
    btn.Attributes.Add(
    "onclick", string.Format("return openSPPopup('{0}?{1}={2}', '{3}')", YourPage_URL, var1_Name, value1, Param1_PopupTitle));
    Step 2 : Javascript function
    function openSPPopup(navigateURL, popUptitle) {
    var options = {
    width: popupWidth,
    height: popupHeight,
    url: navigateURL,
    scroll: 0
    SP.UI.ModalDialog.showModalDialog(options);
    return false;
    Step 3: The popup close code (in .cs file) – I do it this way as it is just close dialog code and easy to write.
    protected void btnClose_Click(object sender, EventArgs e)
    { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", "SP.UI.ModalDialog.commonModalDialogClose(1, 1);", true);
    Courtesy -
    Thread
    Try this - https://bramdejager.wordpress.com/2011/03/21/using-sp-ui-dialog-and-sp-ui-notify-from-code-behind/
    http://msdn.microsoft.com/en-us/library/ff798390.aspx
    http://stackoverflow.com/questions/9833907/asp-net-confirm-before-executing-codebehind
    http://www.codeproject.com/Questions/443131/Call-to-javascript-Function-from-code-behind-using
    http://www.c-sharpcorner.com/uploadfile/ledomoon/calling-code-behind-function-in-javascript/
    Hope they will help!
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • What's New Web Part will not show updates from Team Discussion Web Part

    I have a Team Discussion Web Part which I want to show in the "What's New" updates Web Part. I have indexed the "modified" column of the team discussion and added it as a target list for the What's new Web Part, however updates to the Team
    Discussion are not showing up in the What's New Web Part.
    If I happen to tell the What's New web part to "use the below person column as a filter" and choose "Modified By", the page will crash with an error stating that the What's New web part caused the failure.
    Any suggestions?

    Hi KinsDotNet,
    According to your description, I could reproduce this issue.
    The following alternative solution consists in using the " Team Discussion " web part (with a customized view) in place of the " What's New " web part.
    Alternative solution steps:
    1. Create an index on the “ Modified ” field of the “ Team Discussion ” library in the Site Collection page in which “ What’s New ” web part’s functionality is needed
    2. Insert a “ Team Discussion ” web part in the same page and position where the “ What’s New ” web part was intended to be situated, or wherever it is needed
    3. Click on the “ Save & Close ” icon to save the page with the new “ Team Discussion ” web part
    4. Click on the “ Edit Web Part ” option in the  “ Team Discussion ” web part’s context-menu and click on the “ Edit the current view ” link inside the “ List Views ” section of the web part’s settings box
    5. Choose the desired display columns in the “ Columns ” section
    6. Set the “ Sort ” and “ Filter ” sections settings according to the following screenshot:
    7. In Step 6 , likely two identical “ Modified By ” options will be seen inside the “ Filter ” section’s “ when column ” drop-down.
     Selecting the second of these two “ Modified By ” options will likely cause the “ Team Discussion ” web part to not  work properly, so please make sure to select the first “ Modified By ” option. If, in the unlikely case, after  selecting the
    first “ Modified By ” option the “ Team Discussion ” web part does not render properly, go back and  select the second “ Modified By ” option and the web part should render properly
    8. In the “ Item Limit ” section, set the “ Number of items to display ” to the maximal amount of items you would like to be displayed inside the web part (for example:  5 )
    9. Click the "OK" to save the settings
    A similar post for your reference:
    http://social.technet.microsoft.com/Forums/en-US/dbdc67ed-1453-4045-b2a7-b6ab83b23c8c/include-discussion-board-on-a-whats-new-web-part?forum=sharepointgeneralprevious
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Connectable Visual Web Parts

    Hi..
    how to use Connectable Visual Web Parts in 2 different pages.
    Ravindranath

    The old SharePoint framework has a framework for that, cross/page web part connections:
    http://msdn.microsoft.com/en-us/library/dd585662(v=office.11).aspx I'm not entirely sure if you still can create those kind of web parts in 2010 and you'll have to find that out,
    but the new web part connections framework doesn't support cross-page connections.
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • Content query web part is not working after chaning the DNS entry

    Hi all,
    We have a content query web part in the sharepoint site but it is not working after changing the DNS Entry for the web site ipaddress from one server to other . But it is working fine on the server, if we try to access the site from other system content
    quey server its not working fine and its giving error message as bellow.
    Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.
    Can anyone help me to fix this issue please.

    I have custom XSLT . But it is working fine before changing the dns entry as soon as we change the DNS entry the content quey web part is not working. I tried to delete the content query web part and add it once again to the page, As soon as content query
    web part is added to the page the fallowing error message is displayed.
    Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.
    Can anyone help me to fix this issue please.

  • Web Part is not visible in Web Part gallary

    Hi,
    I have developed a project in sharepoint having two web parts inside it.
    Initially, when there was only one web part in my project it was working fine. But suddenly when i added a new web part, it is not showing me web parts in a gallary. Event it is not available in web part list under Web Designer Gallaries.
    I tried with old .wsp to deployed, but still the same problem.
    On my development machine it is working with two web parts very good. but when i try to deploy that wsp on production site, it is not showing me anything in web part gallary while it was when i was working with one web part only in my project.
    Please, direct me where i am doing wrong, any possibilities?
    I did workarounds as
    1.  Check for the custom webpart feature folder under 14\TEMPLATE\FEATURES ----- Yes it exists there
    2. If the feature Scope is Site
    3. The webpart dll is deployed to GAC with Stsadm command
    4. No web part(My Custom) found here Site Action > Site Settings > Galleries > Web Parts

    in my development environment i checked in site collection feature, it isn't available in site collection feature but still i am getting those web parts in web part gallery while adding it on page.
    Also, in Production environment, feature is available in /templates/features folder after deployment, but not available in web part gallery while adding it on page.
    I tried with uploading .webpart file which is available in /templates/features production environment as i mentioned, is running for one web part. Not for second web part and giving me security error.
    As, uploading .webpart file is not feasible solution, please tell me how could i do that with .wsp file?
    please tell me what could be another workaround. 
     

  • How to Add a User Control to a SharePoint 2013 Visual Web Part ?

    Hi,
    1.I have created SharePoint 2013 Farm Solution through VS 2012.
    2.Added visual Web part
    3.Created a User control (Farm Solution ) and added some Control From tool Box.
    4.Drag and drop user control from solution explorer to visual web part.
    so its  Register tag and with prefix tag user controls automatically added on visual web part source. when i try to build solution it throws Exception:
    Exception :The name 'InitializeControl' does not exist in the current context.
    Please Provide solution after try/or proper workaround.
    Thanks,
    Siddheshwar

    Site name=http://sitename:22222/
    Visual Web part:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Src="~/_controltemplates/15/SP2013Controls/SPControls.ascx" TagPrefix="uc1" TagName="SPControls" %>
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SPWebpart.ascx.cs" Inherits="SP2013Controls.SPWebpart.SPWebpart" %>
    <uc1:SPControls runat="server" id="SPControls" />
    User Control Code:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SPControls.ascx.cs" Inherits="SP2013Controls.ControlTemplates.SP2013Controls.SPControls" %>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:Button ID="Button1" runat="server" Text="Button" />
    Deployement Location:{SharePointRoot}\Template\ControlTemplates\SP2013Controls\
    After User controls added on webpart .g.cs file getting blank.
    After 1st Build:
    'InitializeControl' does not exist in the current context
    The file '/_controltemplates/15/SP2013Controls/SPControls.ascx' does not exist.
    after 2nd Build Try:
    'InitializeControl' does not exist in the current context

  • What can I use to list the specific web part types on a specific page?

    A user is trying to create a new entry on a sharepoint page. The page has various web parts showing bulleted lists of links.
    However, when he tried to create a new one, he ends up with the links having no bullets and the letters URL in a title bar over the links. The other link web parts do not have that.  The title bar allows sorting of the links; the other web parts have
    no title bar at all.
    This new web part has no "edit" option to modify parameters like titlebar, etc.
    Is there a powershell way that I could provide a URL and get the list of web parts, their types and their titles so that I could see what is going on and try to help him fix things?

    You can check all these out via the Web Part Maintenance Page. After the PageName.aspx, add ?contents=1 and you'll get a list of the webparts that are open and published on the page.
    You can't do too much here but you can reset the parts that you think might be causing the problems.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • HOW TO CALL APPROVAL WORK FLOW ON BUTTON CLICK EVENT OF VISUAL WEB PART?

    Hiall,
    I created an OOB an approval work flow I want to start that approval work flow through visual web  part button click event
    In work flow Settings I selected to manually start .Is this possible ? if possible please guide me how to do this
    Thanking you,
    Arun  kumar

    Hi,
    If you have an instance of SPListItem, and know the workflow association name, you can start it. First you need to find workflow assocation instance and tell SPSite.SPWorkflowManager to start your workflow.
    See this for more information:
    http://blog.mmasood.com/2012/06/programatically-start-workflow.html
    Please remember to up-vote or mark the reply as answer if you find it helpful.

  • Sharepoint visual web part

    Hello, I would like to create visual web part, that can be used within SharePoint LIST's edit item form...I want to include treeview into the webpart and load a directory structure to it...a direcotry structure is meant a Folder hierarchy from fileprint
    server - share.
    to browse through share I use:
    stringsourcePath
    ="D:\\";
    foreach(stringdr
    inSystem.IO.Directory.GetDirectories(sourcePath))
    but I am receiving this error:
    An exception of type 'System.Security.SecurityException' occurred in prva.dll but was not handled in user code
    Additional information: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
    stack trace:
       at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
       at System.Security.CodeAccessPermission.Demand()
       at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
       at System.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption)
       at System.IO.Directory.GetDirectories(String path)
       at prva.VisualWebPart1.VisualWebPart1.Page_Load(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
    please, help if possible

    You code failes because of security permission,set <trust level="Full" />
    see these threads, should help you to resolve
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/3c10b18b-b098-4967-8664-137bee9c2dcc/request-for-the-permission-of-type-fileiopermission-failed?forum=sharepointdevelopmentlegacy
    http://forums.asp.net/t/1422162.aspx?System+Security+SecurityException+Request+for+the+permission+of+type+System+Security+Permissions+FileIOPermission+mscorlib+Version+2+0+0+0+Culture+neutral+PublicKeyToken+b77a5c561934e089+failed+
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • Sharepoint 2013 Visual Web part Deloyment

    Hello,
    I built a visual web part(sharepoint 2013) using visual studio 2012. But when I tried deploying, I got this error message:
    "Error occured in deployment step 'Activate Features': Feature id '****' is not installed in this farm, and cannot be added to this".
    Approaches I made to fix this :
    1) Tried changing the scope of Feature to Farm/Web/WebApplication
    2) Tried installing feature manually using Install-SPFeature -AllExistingFeatures
    3) Tried resetting IIS
    None of these attempts helped me. Can someone help me on this ?
    Thanks
    KG

    Hi,
    According to your post, my understanding is that you get error while deploying the visual web part.
    To narrow down whether the issue is related to the project itself, you can do some steps as below.
    Re-open the visual studio, create a new clean project with a simple visual web part then check whether it works.
     What’s more, you can check whether feature assembly is register in GAC or not. So try to uninstall feature and use below command: (if have not done before)
    Install-SPSolution -Identity MYfeature.wsp  -GACDeployment -force
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

Maybe you are looking for