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


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

Creating custom property on derived Page

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :WPF
 
I am attempting to accomplish the following during the creation of a Page derived from DerivedPage: <local:DerivedPage xmlns="..." xmlns:x="..." xmlns:local="..." MyProperty="My Value" Title="My Title"> ... </local:DerivedPage> You'll notice an extra property MyProperty in there. The code-behind is like this: class DerivedPage : Page { public string MyProperty { get; set; } ... } When I execute this, I get a null reference in InitializeComponent() when I create a Page derived from DerivedPage. I also tried making MyProperty a dependency property.  But I get the same results. How can I create a property for my new base-class that's set in the markup of my derived class. Thanks, ...Matt


View Complete Post


More Related Resource Links

Help with creating graphs in a site page from figurative data in custom list

  
Guys Can anyone provide me with someone help please? I need to be able show a graphs/line format in a web part of a site page on my SP 2010 site. I want to use some changing figurative data that is contained within a custom list change a the line/pie chart graph on the fly that is located within a chart/line graph in a site page. Basically when the data in the custom list gets changed by my resources I want to be able to see the changes in the graph almost like a live dashboard. I would be very greatful for some help. Note: I am not a coder nore do I ever claim to be, but if I could get a step by step guide on how to achieve this then I would be very greatful. I have a good understanding of SP but I am not to the coder. I able to supply the list if necessary and if someone could provide me with the code/or if code is not necessary for this task then please can you advise how? Many Thanks Mike Gowlett PMP P2P (MCSE, MSP, Old School :-) 

not able to set custom property of web part on page load

  

I am not able to set the custom property of the web part on page load.

It gives me exception if i try to get or set that property but i can still access other inbuilt property of the web part and can display them on the page.

 

I am using sharepoint designer and MOSS 2007.


The page cannot be displayed error when creating new item in custom list

  

Hi i am workign with a cutom list and every time i try to add a new item and hit ok i get the error shown below. Sometimes it happens and other times it doesnt and it only happens with a select few. One way of getting around this error is to not edit it on the page on which it is on but to go to view all content then to the custom list.

I have tried observing whether there was an issue with the pages being checked in and checked out but all pages were checked in and published. I tried deleting and recreating the custom list and no luck. Your feedback would be much appreciated! Thanks in advanced

btw i am a user with full control and our site is being hosted.

The page cannot be displayed

 

creating custom error page

  

Hi ..

I have two errors in my application i want to display a custom  defferent error page for each error...

Here is my code

protected void Button1_Click(object sender, EventArgs e)
    {
      
            int a = 10;
            int b = 0;
            int c = a / b;
     
      // FIRST ERROR
   

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
       
       

            string str = "hjdfgjh";
            int vv = Convert.ToInt32(str);
       
        //SECOND ERROR
       
         
    }


i have configured web.config like b

How to Make a custom property or a page persist across postback

  

Hi,

As the title suggests, I have an object to hold some specific state information in my web application - I pass it back & forward between pages by making it a property of a basepage which works fine, but I lose it on postback.

Is there any way to persist this property without manually adding & reading it again from viewstate?

Thanks

 


steps for creating a custom master page in SharePoint 2010

  

Hi

Can any one please help me out to prepare a custom master page in SharePoint 2010 designer and deploy it to SharePoint site.

i have a html page , which i want to put in my custom master page.

please help

 


Custom Controls derived from existing controls - overriding default property values

  

I have some (probably very basic) questions about developing custom controls.  I am wanting to derive a set of button controls, and the first one I have started on is a "DeleteButton", that has a additional property (DeleteConfirmationText) that is built into the OnClientClick attribute.  To get that added, I overrode the Render method as follows:

protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("return confirm('{0}');", this.DeleteConfirmationText));
            base.Render(writer);
        }

This all works well.  Now, I will add some logic to make sure that there is some text in the DeleteConfirmationText property, but that isn't the intent of my question.

What I am also wanting to do is to override some of the default property values, so I added that to the default constructor:

public DeleteButton()
        {
            // Default the command name, and the button text to "Delete".
            this.CausesValidation = false;
            this.CommandName = "Delete";
            this.Text = "Delete";
        }

Now, in the designer in VS2008, and I look at the properties for the control, there isn'

Creating a custom page for a different action - not insert/details/edit/list?

  

If want to make a new page with a different action (not insert/edit/details/list) is the website root the right place to put it?  That seems to be the only place where I don't get a "404 - Not Found" error.  I just wondered if there's a best practice for this ... maybe creating a new action in addition to List/Edit/Insert/etc so that my page can go in the same folder with the other pages for the same table.  For example could I add a "Print" action and then put my page in DynamicData/CustomPages/SurveyResponses/Print.aspx?

Thanks in advance!


Creating Custom Page in Dynamic Data Application

  

To create a custom page I copied the List.Ascx file from the Page templates to DynamicData\CustomPage\"MytableName"

I keep getting the follwing errors mainly in list.aspx.designer

"The type 'L2SDynamicData.List' already contains a definition for GridView1"

"The type 'L2SDynamicData.List' already contains a definition for table1"

"The type 'L2SDynamicData.List' already contains a definition for HeadContent"

"The type 'L2SDynamicData.List' already contains a definition for DynamicDataManager1"

"The type 'L2SDynamicData.List' already contains a definition for UpdatePanel1"

 

There are about 32 of these error types

 

 


Creating Custom Page in Dynamic Data Application

  

To create a custom page I copied the List.Ascx file from the Page templates to DynamicData\CustomPage\"MytableName"

I keep getting the follwing errors mainly in list.aspx.designer

"The type 'L2SDynamicData.List' already contains a definition for GridView1"

"The type 'L2SDynamicData.List' already contains a definition for table1"

"The type 'L2SDynamicData.List' already contains a definition for HeadContent"

"The type 'L2SDynamicData.List' already contains a definition for DynamicDataManager1"

"The type 'L2SDynamicData.List' already contains a definition for UpdatePanel1"

 

There are about 32 of these error types

 

 


Web Part Custom Property Text Values Showing Up on Page

  

I've created a basic Web Part in a .wsp and defined two custom web properties.

However, whatever value I place in these text values when in the edit mode show up on the Page beneath the Web Part name.  Why?  How do I not show the value of Properties outside of the Modify Property window?


How to automatically enable web part connections when creating a publishing page based on a custom p

  

I have created a simple custom page layout in SharePoint Designer, added a couple of web part zones, and a custom web part on each zone.

These web parts have a custom provider-consumer set of interfaces. I configured the connection between the web parts in SharePoint Designer (using Add Connection wizard), and saved the page layout.

After that, I checked in the layout and approved it in SP's web interface.

Finally, I created a Publishing Page based on my layout, but the connection between the web parts was not set. I can set the connection manually and it works fine, but I would like the connection to be automatically set on each page I create based on the layout.

Is this the expected behavior? If so, is there a way to configure the connection automatically either programmatically or declaratively?

Is there a step I'm missing?


Custom Server Control Property not maintaining state

  

I have created a server control consisting of a TextArea and a div under it.  My goal is to create my own asp:TextArea type control.  the div is for a Character count of the text area and seems to work ok but i added a CharacterCountVisible property to the control that is always returning true.  See Proptery definition below

 

<Bindable(False), Category("Appearance"), DefaultValue("True"), Localizable(True)> Property CharacterCountVisible() As Boolean
    Get
        Return _CountBoxVisible
    End Get
    Set(ByVal value As Boolean)
        _CountBoxVisible = value
    End Set
End Property

Note the _CountBoxVisible variable is define inside the class as :

Dim _CountBoxVisible as Boolean = True

What I am trying to do is give the user/coder the option to show/utilize the char count feature.  Can make it disappear with textarea1.CharacterCountVisible = False but setting it to true will not make it display.

 

What am i missing

 

Thanks

 

 


{ End Bracket }: Creating a Custom Metrics Tool

  

Metrics play an important role in our lives. Even if we don't realize it or characterize it as such, many daily activities have the potential to be quantified to some degree. So it's not surprising that metrics play an even greater role in the workplace, where there are goals and a bottom line and where much of a day's activity can be summarized in numbers.

Stephen Toub

MSDN Magazine April 2005


Unable to search Custom User Property Created in User Profiles in SharePoint 2010

  

Hi ,

I have created a custom user property,and created metadata property and added mapping to it, still i m not able to Search in People,Please advise


Creating a custom column with a link to document (other than the name field) in document library

  

Hello!

I have a document library with the standard name column linking to the document. However, we'd like to create a custom field and have that link to the document (and edit item menu).

How is this best accomplished?

Thanks in advance!

T


Apply custom.master to "Site Settings" page?

  

I'm using a custom.master page, which is applied to almost all pages available to READ users.

However, I'd like to apply it to the Search, Site Settings, and View All Site Content pages.

I'm not sure where this would be applied.

Guidance much appreciated. Thanks!


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