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


Top 5 Contributors of the Month
Kaviya Balasubramanian
satyapriyanayak
SP
abhays
Sasi Prabhu
Post New Web Links

Attached property usage error (Repost for clarity)

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :JQuery
 
<Window x:Class="WpfApplication4.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="WpfApplication4"
  Title="Window1" Height="300" Width="300">
  <Grid>
    <TextBox Height="23" Margin="86,0,72,106" Name="textBox1" VerticalAlignment="Bottom" Style="{StaticResource BigHonkingDigitOnlyTextBox}" />
  </Grid>

  <Window.Resources>
    <Style x:Key="BigHonkingDigitOnlyTextBox" TargetType="TextBox">
      <Setter Property="FontSize" Value="36" />
      <!-- honking


View Complete Post


More Related Resource Links

Attached property usage error

  
I am trying to use attached property...

And i get errors ... here is my code

<

Window x:Class 
="WpfApplication4.Window1"


 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 

xmlns:local="WpfApplication4" 
 

Title="Window1" Height="300" Width="300"> 
 

<Grid 
>


 

<TextBox Height="23" Margin="86,0,72,106" Name="textBox1" VerticalAlignment="Bottom" Style="{StaticResource BigHonkingDigitOnlyTextBox 
}" />


 

</Grid 
>


 

<Window.Resources 
>


 

<Style x:Key="BigHonkingDigitOnlyTextBox" TargetType 
="TextBox">


 

<Setter Property="FontSize" Value 
="36" />


 

<!-- big -->


 

<Setter Property="local:InputBehaviour.HonkOnKeyPress" Value 
="True" />


 

<!-- honking -->


 

<Setter Property="local:InputBehaviour.IsDigitOnly" Value 
="True" />


 

<!-- digit-only -->


 

</Style 
>


 

</Window.Resources 
>


 

 

</

Window>

 

 

 

 

using

 

System;

using

 

System.Collections.Generic;

using

 

System.Linq;

using

 

System.Text;

using

 

System.Windows;

using

 

System.Windo

Jscript error: Object does not support property or method

  

 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Using Dynamic Property inside Html Helper with Razor fires an error

  

Hello,

I have the following with Razor:

@Html.GoogleAjax(View.GoogleAjaxKey, new String[,] { { "jquery", "1.4.2" } })

And the I get a strange error:

  'System.Web.Mvc.HtmlHelper<object>' has no applicable method named 'GoogleAjax' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.

What is strange is that it works fine using:

@Html.GoogleAjax("123", new String[,] { { "jquery", "1.4.2" } })

I tried the following code line:


@View.GoogleAjaxKey

And the key is displayed just fine so the problem is how I use the value of @View.GoogleAjaxKey into Html.GoogleAjax.


Do I need to change something on my Html Helper? Here it is:


    public static MvcHtmlString GoogleAjax(this HtmlHelper helper, String key, String[,] libraries) {

      

error in MicrosoftAjax.js: Cannot read property '_notified' of null

  

I am cross testing my project with multiple browsers: IE7, Firefox and Chrome.

One one page I have a dynamically built table with two DropDownLists and CascadingDropDown extenders. Maybe the only thing special about the drop down lists is, that I add a "onChange" for the second drop down list in each row which shows or hides the list depending on the value populated from the web services.

All of this works perfectly in IE7 and Firefox, but Chrome does not execute the JavaScript in the onChange attribute and the error console says:

Uncaught TypeError: Cannot read property '_notified' of null

Object or Property is not supported in IE8 - javascript error

  

Hello,

I am using following code line in my web app through external javascript file.

 

this.ViewState.removeChild(this.ViewState.firstChild); 

and

window.__doPostBackOld(arguments[0],arguments[1]);

 

both these methods are working fine in IE6 but failing in IE8 with a error: "Object or Property is not supported".

 

any solution would be appreciated!

 

Thanks


Viewmodel property not set to [Required] yet getting error message saying it is?

  

I have a viewmodel that i use for my view


public int SelectionId{ get; set; }        
public IEnumerable<Selections> Selections { get; set; }


Notice that SelectionId is not decorated with [Required]. In my view, i use DropDownFor like this:


<%= Html.DropDownListFor(m => m.SelectionId, new SelectList(Model.Selections, "Id", "Name"), "--- Select ---")%>



It should be possible to not select anything from the dropdown, resulting in model.SelectionId = 0, which is fine. Why do i get a "SelectionId field is required" error when i Post?  If i do this:

<%= Html.DropDownList(mySelectionId, new SelectList(Model.Selections, "Id", "Name"), "--- Select ---")%>


I no longer get the error if i dont select anything, which is what i want - but no way to bind it to the id if the user does select something


thanks for any help!



MDW Disk Usage for Database Report Error - A data source has not been supplied for the data source D

  
Hello, On the MDW Disk Usage Collection Set report, I get the following error when I click on a database hyperlink. A data source has not been supplied for the data source DS_TraceEvents SQL profiler shows the following SQL statements are executed (I've replaced the database name with databaseX) 1. exec sp_executesql N'SELECT dtb.name AS [Name] FROM master.sys.databases AS dtb WHERE (dtb.name=@_msparam_0)',N'@_msparam_0 nvarchar(4000)',@_msparam_0=N'databaseX' this returns zero rows as databaseX does not exist on my MDW central server, but is a database on a target server (i.e. one that is being monitored and uploaded into the MDW central server). 2. USE [datatbaseX] this produces the following error: Msg 911, Level 16, State 1, Line 1 Database 'databaseX' does not exist. Make sure that the name is entered correctly. why is the report looking for the database on my server? thanks Jag Environment: MDW (Management Data Warehouse) on SQL 2008 R2  

error in MVC2 on empty string form fields which are required: "This property cannot be set to a null

  
In model I have:[DisplayName("ISBN")] [Required(ErrorMessage = "ISBN is required.")] [StringLength(50, ErrorMessage = "ISBN book must have max {1} chars.")] [DisplayFormat(ConvertEmptyStringToNull = false)] public string isbn { get; set; }But when I submit form with empty field ISBN I have an error - ConstraintException: This property cannot be set to a null value.I have find that other people have the same problem and they say that debbugger in VS2010 works wrong - yes ?http://p2p.wrox.com/book-professional-asp-net-mvc-2/79788-constraintexception-unhandled-user-code.html#post259245http://efreedom.com/Question/1-3129080/Server-Side-Validation-REQUIRED-String-Property-MVC2-Entity-Framework-Workhttp://mvcmusicstore.codeplex.com/workitem/6604

Error "Object reference not set" when I try to set a Navigation Property

  
I'm using Entity Framework. The following code throws a runtime error "System.NullReferenceException: Object reference not set to an instance of an object." The line before the error, it looks like newControl is in fact instantiated.My model has a Control entity and a ControlType entity. Control includes the Navigation Property "ControlType." I'm trying to set ControlType.Type = 2.SurveyFormControlsModel.Control newControl = new SurveyFormControlsModel.Control(); newControl = CreateControl(childTokenName, ControlTypeEnum.TextBox); newControl.ControlType.Type = 2; // <<--ERROR HERE context.Controls.AddObject(newControl);                                SurveyFormControlsModel.Control newControl = new SurveyFormControlsModel.Control();                                 if (listItems.Count == 0)                                 {                                     newControl = CreateControl(childTokenName, ControlTypeEnum.TextBox);                    &

SQL Server 2008 Express Setup failure: Unknown Property Error

  
I am trying to install SQL server 2008 on windows 7 but it returns the following error when almost done with installation: TITLE: SQL Server Setup failure. ------------------------------ SQL Server Setup has encountered the following error: Unknown property. . ------------------------------ BUTTONS: OK ------------------------------   Can someone please assist me with this, I have tried for more than a week to go around it. I have also searched online for solutions but in vain. Looking into the log files, I see these: 2010-09-05 21:04:41 Slp: Running Action: Install_SqlBrowser_Cpu32_Action 2010-09-05 21:04:41 Slp: Target package: "C:\Softwares\Database and Management\SQLEXPRADV_x86_ENU\x86\setup\sqlbrowser.msi" 2010-09-05 21:04:46 Slp: InstallPackage: MsiInstallProduct returned the result code 0. 2010-09-05 21:04:46 Slp: RunMsiCore succeeded. 2010-09-05 21:04:46 Slp: Checkpoint: INSTALL_SQLBROWSER_CPU32_ACTION 2010-09-05 21:04:46 Slp: Completed Action: Install_SqlBrowser_Cpu32_Action, returned True 2010-09-05 21:04:46 Slp: ---------------------------------------------------------------------- 2010-09-05 21:04:46 Slp: Running Action: Install_SqlSqmShared_Cpu32_Action 2010-09-05 21:04:47 Slp: Error: Action "Install_SqlSqmShared_Cpu32_Action" threw an exception during execution. 2010-09-05 21:04:47 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExec

Validation error: This property can not be set to a null value [updated with test case!]

  
Hi, In a dynamic data web application, I get a validation error on a non-null nvarchar(50) column in ListDetails.aspx, even though I have entered a value which should be accepted. The validation error is: "This property cannot be set to a null value.". I can not reproduce this on northwind/adventureworks. Any ideas? UPDATE: I have created a complete test case: http://printf.no/DynamicDataBugTest.zip (The archive was scanned with the latest AVG definitions before uploading to my private secure dedicated FreeBSD server) The test case contains: One Dynamic Data Web App project One MS SQL Server 2005 database backup which contains a single table with three columns One screenshot showing how the error manifests itself I am fairly convinced now that this is a reproducible DD bug. -Andreas

Error Creating Control - 'asp:UpdatePanelAnimationExtender' could not be set on property 'Animati

  
It doesn't seem to matter what I try to make the animation do, I keep getting this shown in the designer. No one else on google seems to be getting that problem either. Note: it doesn't cause debugging or runtime issues... in fact, the only negative thing it does is make it extremely annoying when I look at the designer... I'm going to have about 12 of these updatepanelanimations firing everytime the timer ticks too :(. MasterPage file has the toolkitscriptmanager on it. Here is my designer code for the page I'm having the issue on:<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.Master" CodeBehind="TimeLine.aspx.vb" Inherits="TimeLine.WebForm1" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:Timer ID="Timer1" runat="server" Interval="7000"> </asp:Timer> <asp:Panel ID="Panel1" runat="server" Height="285px" HorizontalAlign="Center" Width="970px" BackImageUrl="~/Images/Img.jpg"> <br />

Setting an attached property by a Setter element?

  
I have the fragment below as contents of a <Grid> element. The idea is that if the checkbox is checked the <TreeView> element should only span one instead of two columns. When I check the checkbox the background of the treeview turns red, but the treeview continues to span 2 instead of 1 column. It's a bit like the attached property Grid.ColumnSpan does not get assigned by the <Setter Property="Grid.ColumnSpan" Value="1"/> at all. What should I do in order to achieve what I want?Best regards,Henrik Dahl   <TreeView    x:Name="Blas"    ItemsSource="{Binding Path=BlasRoot.Children}" d:LayoutOverrides="Width" Margin="0,0,0,8" Grid.Column="0" Grid.ColumnSpan="2">    <TreeView.Style>       <Style>          <Style.Triggers> <DataTrigger Binding="{Binding ElementName=chkPosition, Path=IsChecked}" Value="True">    <Setter Property="Grid.ColumnSpan" Value="1"/>    <Setter Property="TreeView.Background" Value="Red"/> </DataTrigger>          </Style.Triggers>       </Style>    </TreeView.Style> </TreeView> <CheckBox HorizontalAlignment="Left" Margin="-50,0,0,0" x:Name="chkPosition" VerticalAlignment="Top" Content="

Unknown error - Site usage reports not displaying - 2007 environment

  

Please can you help out in this issue as this is something critical.  Thanks much in advance.

 

when user clicks site usage reports (site actions > site settings) displays error as unknown error, and user is admin for the site.

 

This is on particular site. This problem is only for one user and rest of the users able to get the reports when hits on site usage reports.

 

I have checked with user . he is getting same problem on other browsers as well.

 

as pat of investigation we have migrated this site to other environment and asked user to che

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