.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Code behind feature not working

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :SharePoint
 

Hi.

I am using WSS 3.0 on Win 2003 and SPD 2007.

I have created a list and created a customized the corresponding NewForm.aspx to with different sub headings as there are many columns and named it NewForm_v2.aspx. To this I've added a label and button to test code-behind features.

The problem:

I have created built a class library in VS2005 > assigned the key etc and finished all other formalities. Changed inheritance tags as well in NewForm_v2.apsx. But when I press the button it is not invoking the method present in the class library (The button should change the text in the label)

My next question is how to debug my code-behind? I've read some articles and tried, but could not hit my break point yet ...

Thanks for your help!

Regards




View Complete Post


More Related Resource Links

Code write file asp.net 2.0 is working in firefox but IE not working.

  
If Not IsDBNull(ext) Then                                        ext = LCase(ext)                                    End If                                    Select Case ext                                        'Case ".htm", ".html"                                        '    type = "text/HTML"                   

Convert VB Code to working C# code

  
Hello. I am a beginner and I'm trying to work my way through the MSDN  beginner tutorials. The lesson I am working on had to do with transferring info to another page using a Session object. The example video is written in VB code. I tried to write this part of the lesson in C# code and where the VB code works I am getting an Error message in C# code saying 'The name 'Session' does not exist in the current context' and hence the program will not compile. here is VB Code on default.aspx page     Protected Sub nextButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles nextButton.Click     Dim bill As New Billing bill.FirstName = firstNameTextbox.Text Session.Add(   "billingInformation", bill) Response.Redirect(   "SessionResult.aspx") End Sub VB SessionResult.aspx code is:     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load     Dim bill As Billing = Session("billingInformation")     Dim sb As New System.Text.StringBuilder() sb.Append(   "First Name: ") sb.Append(bill.FirstName) sb.Append(   "<br>") Response.Write(sb.ToString())     End Sub My C# code looks like this for default.aspx page and SessionResult.aspx page &nb

Working with Code Snippets in VS.NET

  
INTRODUCTION Creating code snippets using VS.NET is very useful tip because it may help you when you need to write code repeatedly within your applications. For instance, we may use try catch finally block very often. Rather than writing the complete code-block manually, we may save it as a Code Snippet, then use it anywhere we want. In this blog post, I will show you how to create, save and use Code Snippets, where you will see why Code Snippets are extremely useful, especially if you know that you may have various cases where you will apply such or similar code-blocks. WORKING WITH EXISTING VS.NET CODE SNIPPETS Microsoft has provided us with code snippets that developers use in most of the cases. In order to see the already existing code-snippets, in code-behind of your .net application, use the following shortcut keys: CTRL+K+X Insert Snippet will appear you can select one of the given folders, and some predefined code snippets will appear The line above the snippets shows the path to the snippet (1) where you can write the shortcut key of the snippet you want to insert (for faster approach). In our case, we select the try (2) snippet, which will insert the following code:         void MyMethod()         {            &nbs

Ldap authenication code is not working with IIS but works with Visual Studio developement webserver

  
Hi,I have weird issue here, I have a method that  takes a login Id and authenticates with LDAP active directory and returns the employee Id.It works great when I run the application in Visual studio 2008 ( it uses the default visual studio developement webserver). The code authenitcates the login id and returns emp Id perfectly. But the problem comes when I publish the code to the Local IIS in my developement PC.public string GetEastWestTeamMembersEmployeeID(string loginID)        {            string domain = string.Empty;            string login = string.Empty;            int position = loginID.IndexOf(@"\");            string empid = "";                  System.DirectoryServices.DirectoryEntry directoryEntry = null;            if (position >= 0)            {                domain = loginID.Substring(0, position);    &n

Retract custom master page feature and all site pages stop working

  
There is a requirement to apply custom branding on personal sites in a SP 2010 project. For this I have created a feature which uploads and applies the custom master page on creation of any new personal sites.   I have stapled this feature (using feature stapling concept) to the “SPSPERS” (personal site) site definition. The custom master page is displayed on the creation of new personal sites. On feature deactivation, I am looping through all the personal sites (as the feature is deployed on a team site) and pointing the master URL back to v4.master. But when I retract the solution and browse to the personal site, I am getting a “404 File not found” error.  But am able to view the settings page by typing the URL.   I activated the publishing features and looked at the master page applied to the personal site. It was pointing to v4.master.   Any help on this is appreciated. Regards, Neha

Retract custom master page feature and all site pages stop working

  
I have stapled this feature (using feature stapling concept) to the “SPSPERS” (personal site) site definition. The custom master page is displayed on the creation of new personal sites. On feature deactivation, I am looping through all the personal sites (as the feature is deployed on the root site) and pointing the master URL back to v4.master. But when I retract the solution and browse to the personal site, I am getting a “404 File not found” error.  But am able to view the settings page by typing the URL.   I activated the publishing features and looked at the master page applied to the personal site. It was pointing to v4.master. Any help on this is appreciated. Regards, Neha    

Running code after site definition site creation in a event receiver or feature receiver

  
Hi guys I've got a site definition which is pretty much based on STS.This is it's own sharepoint project. Let's call this project SiteDefProj. Next in another SharePoint project (same solution though). Let's call this CustomListProject. In this project I've got a feature which provisions a bunch of lists based on custom content types - this feature is a site scoped. Let's call this feature: CustomListInstances. I have added a feature receiver to this feature to execute some custom code on the lists themselves (under feature activated) In my ONET.XML (part of the SiteDefProj) I have CustomListInstances feature ID as part of my <sitefeatures>. When I do a create site I can actually step through the code and see it actually being executed but after the site is created the list instances are created but it's like the code never run or did anything. The weird part is that stepping through the code while creating a site collection using my SiteDefProj the code runs great with no errors. All lists are there and the code runs smooth. If I manually create a STS site and activate my feature everything works and the code does actually run and the effects are visible after the feature is created. Again I can actually step through it in debug. My suspicion is that there's some sort of a race condition in the CREATE SITE functionality where maybe the web or site collection hol

Code in an event handler not working when used with system reflection.

  
Hi, I am presently writing an application that uses an MDI form with a ToolStrip on it. I have the need to build the menu items dynamically using an XML file. The format of the XML file is as follows: <ContextMenu EventHandlerHost="vFrmPDUsetup"> <!-- These styles will be applied to the menu items. Individual menu item styles can be override by defining as an attibute to the specific menu item, see below --> <Style> <MenuStripBackColour>Transparent</MenuStripBackColour> <BackColour></BackColour> <ForeColour>Chartreuse</ForeColour> <BackImage></BackImage> <!-- Must exist in Images folder --> <FontName>Tahoma</FontName> <FontSize>10</FontSize> <FontStyle>Bold</FontStyle> </Style> <!-- Attributes: Key = Resource Key name in resource file Image = image to display before text, image must exist in Images folder BackImage = background image, image must exist in Images folder BackColour = background colour as colour name ForeColour = foreground colour as colour name FontSize = size of font as value Seperator = add a menu seperator OnClick = click event pointing to the event handler method which must be defined as the MenuItem_ + <attibute value> &

Feature working only under Admin account

  

Hi,

I had created a feature and activated in the site under the Admin account. The feature was to count the number of files under each sub folder. The feature got activated successfully. I tested the code under the Admin account, and it was working. I tried to test with other users, who had design and contribute access. But when the other users checked, the count was not showing.

This is the code I have used:

[CODE]

  public static void GetOpenItems()
  {
 SPSecurity.RunWithElevatedPrivileges(delegate()
 {
 using (SPSite site = new SPSite(Constants.url))
  {
using (SPWeb currentweb = site.OpenWeb())
  {
 SPListCollection mylists = currentweb.GetListsOfType(SPBaseType.DocumentLibrary);
 for (int q = mylists.Count - 1; q >= 0; q--)                          
 {
 SPList list = mylists[q];

 if (!list.Hidden)
{                             
currentweb.AllowUnsafeUpdates = true;
SPFolder folder = list.RootFolder;
SPView curview = list.Defau

Format Code D0 is not working in SSRS 2008

  

We are trying to migrate all our RDL from SSRS 2005 to SSRS 2008.

In the rdl’s we defined format code for a  text box as “D0”  which is working fine in SQL 2005.

While migrating the rdl’s to 2008 it is not working and data is showing for that text box as “#Error”.

How to resolve this . I am having around 1000+ rdl’s to update with proper format string.

If I open the Rdl in BIDS I am getting below error.

 

[rsInvalidFormatString] The Format value for the textrun ‘textbox1_0_13.Paragraphs[0].TextRuns[0]’ is not valid. Format specifier was invalid.

[rsRuntimeErrorInExpression] The Value expression for

Help Needed working our sp from vb.net code behind

  

I have a formview and am trying to run this code behind but keep getting this error

Procedure or function 'spCBI_ClientUpd' expects parameter '@op_status', which was not supplied


 Function;

    Protected Function UpdateClientAdmin() As String
        ' SP UPDATE ClientAdmin 

        Dim ReturnValue As String = String.Empty
        Dim SQL_Connection As New SQL.SqlConnection
        Dim SQL_Command As New SQL.SqlCommand
        SQL_Connection = New SQL.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("CashbacsMainConnectionString").ConnectionString)
        Try
            SQL_Connection.Open()
            SQL_Command.CommandText = "CASHBACSMAIN.dbo.spCBI_ClientUpd"
            Dim pLicence As New SQL.SqlParameter("@Licence", Data.SqlDbType.VarChar, 6)
            pLicence.Value = TxtLicence.ToString
            pLicence.Direction = Data.ParameterDirection.Input
            SQL_Command.Parameters.Add(pLicence)

            Dim pCompany As New SQL.SqlParameter("@CompanyName", Data.SqlDbType.VarChar, 6)
            pCompany.Value = CType(FormView1.FindControl("CompanyNameTextBox"), TextBox).Text
            pCompany.Direction = Data.ParameterDirection.Input
            SQL_Command.Parameters.Add

AJAX DropDownList won't populate.. error500.. code is working though.

  

Here's what I have.  I was able to debug and traverse through the webservice and return teh array back into the first call method of: return new CarsService()..  But back in the page_load method, I can't get it to update and show up in the page.  what am I doing wrong?!?!

thanks.


<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                 
                    <ContentTemplate>
                     
                    <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="DropDownList1"
                     Category="Make" PromptText="Please select a make" LoadingText="[Loading makes...]"  
             

Code working in Xp bur showing Error in Vista

  

Hi all.

 

I am saving two data, One is date and other one is time in SQL server 2005 using asp.net ( VB.net).

I am saving this using following command:

cmd.commandtext = "insert into TABLE1 values ('" + Now.toshortdatestring + "', '" + Now.toshorttimestring + "')"

cmd.executenonquery

now while i am using this code in Windows Xp its working properly but in Windows VISTA it is showing some "Data Conversion Error  from string to datetime". 

If i remove the single quotes [ ' ] from the command it is showing error in the value of date and time.

thanks all

 

 


Document ID feature not working

  

Hello,

I want to try out the Document ID feature.
I enabled the "Document ID" feature in the Site Collection features list.

That gave me a new setting "Document ID settings" in the "Site Collection Administration" list.
I checked "assign document ids", I specified a prefix, and checked the "reset all document ids..."

I did this last friday, and today there is still no sign of document ids in my document library.
When I check existing documents, or upload new documents, there is no field "document id" when I check the properties.
This column is also missing when I modify or create a new view.

Any ideas what I need to check to get this working ?
I have beta 2 installed (14.0.4536.1000).
Maybe it is a know issue with this version ?


Client Integration feature not working in MOSS 2010

  

Hi,

We have installed Moss 2010 and integrated with ADFS 2.0 and CA SiteMinder. We have created a new website and enabled Client integration feature in MOSS 2010. But, the client integration feature doesnt work in MOSS 2010. We can successfully authenticate each IdP and can login to website. However, when we access any document from sharepoint, it asks for user authentication second time. Previously, we had configured the website same way but we were not getting the issue. But, now we are getting this issue when we access any document from sharepoint.

Any help would be highly appreciated.

Thanks,

Pravin


Retract custom master page feature and all site pages stop working

  

I have stapled this feature (using feature stapling concept) to the “SPSPERS” (personal site) site definition. The custom master page is displayed on the creation of new personal sites. On feature deactivation, I am looping through all the personal sites (as the feature is deployed on the root site) and pointing the master URL back to v4.master. But when I retract the solution and browse to the personal site, I am getting a “404 File not found” error.  But am able to view the settings page by typing the URL.

 

I activated

Running a feature activated code during new site provisioning.

  
I would like to be able to run some simple code that have in a feature whenever a new site is provisioned.  I created the feature and it works just like I want it to.  I left it activated and saved the site template.  Now when I create a new site based on the saved site template the feature activated code no longer runs unless I deactivate and then activate.  I know this isn't suppose to work this way, and after much searching on the internet I am finding the feature stapling (not what I want, that seems to be what I have already done) and SPWebProvisionProvider.  The provider might be what I want but I am not sure how it works and there are no good examples on how to get one created in code and where to place it so that a user can utilize it when creating a new site.  Can someone explain this concept to me in ad nauseum detail.  Thanks in advance.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend