|
I am currently working with a ASP.NET Web site project in Visual Studio 2008 and everytime I make a change to code behind page for a user control and browse to page that is using the user contorl I get the following error:
Unable to cast object of type...
Started by Michael Kniskern on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
When you change....
In order for those changes to take effect, you'd need to build that project so that the code-behind can be compiled into the DLL file for that project .
You're making a change to the code-behind.
That makes sense, from what I understand.
|
|
X=type('x',(str,),{'a':'aaa'})#new type print x print type(x)#how does it print <type 'x'> <class '__main__.x'> <type 'type'>
thanks
Started by zjm1126 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
To....
To assign the __name__ to a built-in gives an TypeError:
>>> x=type('x',(str,),{'a':'aaa'})#new type >>> x.__class__.__name__="x" Traceback (most recent call last): File "<stdin>__ .
|
|
Just playing around with Silverlight a bit and trying to set a style to apply to all TextBlocks. The following XAML:
<Style TargetType="{x:Type TextBlock}"> <Setter Property="Margin" Value="10, 10, 10, 10" /> </Style>
Gives me the error...
Started by Spencer Ruport on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
<TextBlock x:Name="myTextBlock....
<Style x:Key;/Style> ...
Lt;Setter Property="Margin" Value="10, 10, 10, 10" /> </Style>
Optionally, give it x:Key and the value of this attribute use in your TextBlock as StaticResource.
|
Ask your Facebook Friends
|
While defining style in resource dictionary you can use either
x:Name="xyz"
and
x:Type="xyz".
and can reference this style in XAML like {StaticResource xyz}.
Most examples use 'x:Key', and the difference between 'name' and 'key' is that using 'x:name'...
Started by bybor on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
<, you cannot define....
x:type allows you to create a reference that is used by that type
for instance
<Style TargetType="{x:Type Button}"> ...
x:Name allows you to create a reference that you can use by name.
|
|
T x(value) is usually the better choice because it will directly initialize x with value, whereas T x = value might create a temporary depending on the type of value. In the special case where value is of type T though, my guess is that the expression...
Started by rpg on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In the special case where value is of type T though, my guess is that the expression T x = value will always that if value....
You're almost right, the better.
x = value might create a temporary depending on the type of value.
|
|
I had a quick look at the "Related Questions" suggested but I couldn't find one directly related to what I'm asking. Even if there was one, I'd still appreciate your opinion on the best way to do this.
First some context.
I'm working on extending a Java...
Started by Eoin Murphy on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Use reflection to find the type of Grammar and create a new instance of this type using the matching a = newWithExactType(new A(null)); Interface b = newWithExactType(new B(null)); System.out.println("Type of a: "+a.getClass().getSimpleName....
|
|
Hi,
I am trying to extend a base style for a TextBlock. Simple think in WPF world, should be the same in Silverlight. But I get a error on x:Type.
How can I translate BasedOn="{StaticResource {x:Type TextBlock}}" in Silverlight. Anyone out there who achieved...
Started by Calin on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In Silverlight you.
Hence the use of {x:Type SomeType} as a key doesn't work.
For accessing Resources.
|
|
The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'.
I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the correct...
Started by Mike T on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The type X is defined in his assembly reference a type in the page (not the code-behind), you need the assembly information defined.
I'm Mike's coworker, and we worked out a solution.
|
|
I have created a form in my application as follows:
<form action="/search/" method="get"> <input id="search-box" name="search" type="text" size=30 title="Search" value="" /> <input id="search-submit" type="image" alt="Search" src="/images...
Started by Prashant on
, 5 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Clever!
You'll always get mouse co-ordinates....
If you turn off JavaScript you'll see that you do get the x and y parameters in the URL.
Why is it a problem? Can't you just ignore.
If you use an <input type='image'> then you get them.
|
|
Why does this work:
public IList<ICoupon> GetCouponsForSite(string siteSlug) { var coupons = _db.Coupons.Where(x => x.Site.slug == siteSlug) .Select(x => new Coupon(x.id)); var list = new List<ICoupon>(); foreach (var coupon in coupons...
Started by Martin on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
So instead of an explicit cast after the Select as proposed by others (which not too; GetCouponsForSite... .
GetCouponsForSite(string siteSlug) { return _db.Coupons.Where(x => x.Site.slug == siteSlug) .Select(x => new type argument.
|