w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

Bind method result to a Silverlight XAML TextBlock
You can make it a converter and apply it to the binding base in your TextBlock kind of like; <TextBlock Text="{Binding Text, Converter={StaticResource YourTranslatorConverterThingy}}"/> Here's just one article with a bit more explanation. Hope this helps.

Categories : C#

How to declare Labels in xaml for use in both WPF and Silverlight
Here is a piece of Code in xaml that can be shared by WPF and Silverlight and looks like label with Background coloe: <Border Margin="3,0,3,3" Background="#FF00B050"> <TextBlock Text="txt122" FontSize="13" FontWeight="SemiBold" Height="21" Name="label15" Width="133" ></TextBlock> </Border> This means that a Label cannot be used in a shared XAML.

Categories : Wpf

Redirect from aspx to silverlight xaml
You can make a silverlight application within a new aspx page and give link to that aspx page where the silverlight application is hosted. Use this link: http://www.c-sharpcorner.com/uploadfile/raj1979/host-silverlight-in-Asp-Net/

Categories : Misc

How do people usually implement multilanguage in Silverlight/XAML?
You would use a tool like Zeta resource editor to create (and edit) resources for your default language and every supported language as well. Resources have to be named like strings.resx, strings.en.resx, strings.de.resx a.s.o. When you add those resources to your project, a resource manager will take care of the correct language. You can then bind to the strings from XAML or use the class ResourceManager to get strings from code behind. It is described in some detail here How to: Make XAML Content Localizable

Categories : C#

You need to install the latest silverlight developer runtime before opening silverlight project
The good link for the last version of « Silverlight Developer Runtime » (Silverlight_Developer_x64.exe or Silverlight_Developer.exe) is : http://www.microsoft.com/fr-fr/download/details.aspx?id=39597 (French link) http://www.microsoft.com/en-us/download/details.aspx?id=39597 (English link) The last auto-update of Silverlight just install the standard run-time version.

Categories : Asp Net

Server.MapPath() with IIS URL Rewrite Module 2.0
I was looking for the same thing so I gave it a try in a test app. It appears that Server.MapPath() does not acknowledge URL Rewrite Module rules. Here is how I tested using an empty web project (Razor syntax): Rewrite rule: <system.webServer> <rewrite> <rules> <rule name="Rewrite rule1 for test1"> <match url="^test1(.*)" /> <action type="Rewrite" url="{R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> cshtml: <p> The URL for this page is @Request.Url.AbsoluteUri . <br /> MapPath of /test1 is @Server.MapPath("~/test1") <br /> MapPath of / is @Server.MapPath("~/") </p> I

Categories : Iis

Using Server.MapPath() to generate img src, not working
APP_Data is a restricted folder intended for Datasources such as Database only. ASP.Net will not deliver a file in here - try it by going to the URL for that image directly (I.E www.mysite/App_Data/5/62.jpg ) and you will see the error message HTTP Error 403 - Forbidden. Put your images in a folder outside of this and you will be fine, such as a folder in the root Called Images

Categories : Asp Net

Using Server.MapPath to save a file
You can access it through the current context HttpContext.Current.Server.MapPath("~/App_Data/stored"); to get the full file path : var filePath = Path.Combine(HttpContext.Current.Server.MapPath("~/App_Data/stored"), package.Id + ".zip");

Categories : Asp Net

How do i call my CRUD method as a list in xaml.cs
Compiler wants you either to put appropriate using directive for QuestionHint type (not for DAO.DAOQuestionHint, which is really declared), or use it full name like SomeNamespace.QuestionHint. The easiest way to add using is to right-click on QuestionHint and to select "Resolve" from context menu.

Categories : C#

Why won't File.copy work with Server.MapPath
Server.MapPath is a secure method, and requires that you have AspEnableParentPaths set to true for your application. http://msdn.microsoft.com/en-us/library/ms524632(v=vs.90).aspx

Categories : Asp Net

Cannot use Server.MapPath to access a external file
Server.MapPath works only with files that are inside the website and is used by specifying a relative location: string configFile = Server.MapPath("~/App_Data/config.xml.config"); If you want to access a file from some other location you will have to manually provide the absolute path to it: string configFile = @"c:worksome_folderconfig.xml.config";

Categories : C#

How we Redirect one Page to AnotherPage with Server.MapPath
you don't need MapPath here, since you have relative path you can directly call Response.Redirect Response.Redirect("~/ReportPage.aspx"); Server.MapPath will return physical path of given file. For example when we need to read TEXT file inside root folder var lines = File.ReadAllLines(Server.MapPath("~/temp.txt")); But in your case no need of a Server.MapPath

Categories : C#

httpcontext.current.server.mappath and unit testing
You need to abstract out the loading of the XML file. Such as; class WebContentLocator : IContentLocator{ public string GetPath(string relativePath) { return HttpContext.Current.Server.MapPath(relativePath); } } class TestContentLocator : IContentLocator{ string _contentRoot; public TestContentLocator() { _contentRoot = ConfigurationManager.AppSettings["ContentRoot"]; } public string GetPath(string relativePath) { return Path.Combine(_contentRoot, relativePath.Replace("~", string.empty); } } interface IContentLocator { string GetPath(string relativePath); } and in your test inject the TestContentLocator into the code that is doing the XML loading, which would by default be using the WebContentLocator. Fds.ReadXml(_content

Categories : Asp Net Mvc

What using directive do I use for Server.MapPath in a separate .cs file in WebMatrix?
You can assign the Server property to a variable to save a bit of typing: var server = HttpContext.Current.Server; var file = server.MapPath("~/SomeDirectory/Somefile"); To answer the question posed in the title of your post - the using directive you need in the class file is System.Web: using System.Web; I don't know of any "cheat sheet" as such. Experience and a growing familiarity with MSDN help, as does Resharper if you can afford it and have the full version of Visual Studio.

Categories : C#

Server.MapPath returning a path with a folder that doesn’t exists
I don't believe MapPath guarantees that a path exists, it just tacks your virtual path to the context path. I think your problem is that you're using HttpContext.Current.Server.MapPath try using HttpContext.Current.Request.MapPath

Categories : Dotnet

Accessing HostingEnvironment.MapPath() within class called by webservice / website
In the end I've found the following solution: Set the properties on the dependent files: Copy to Output Directory = Copy if newer This copies the files into the bin folder of the Hosting Environment (so it will copy it into either the WCF Service or the WebApplication from the Class Library) HostingEnvironment.ApplicationPhysicalPath then returns this location The difference is the files are being copied cross project when building (I didn't know copy if newer did this). I can therefore access the files from the applications' bin (and not from the Class Library as I was attempting before).

Categories : C#

int equivalent of .charAt() method
Try for (int index = 0; index < numbers.length; index++) { if (String.valueOf(numbers[index]).contains("5")) { System.out.println("Yes"); continue; } }

Categories : Java

Is there an F# equivalent to this C# extension method?
Fwiw, the latest version of F# (3.1) contains exactly what I was after (yay!): [<Extension>] type ExtraCSharpStyleExtensionMethodsInFSharp () = [<Extension>] static member inline In(x: 'T, xs: seq<'T>) = xs |> Seq.exists (fun o -> o = x) [<Extension>] static member inline Contains(xs: seq<'T>, x: 'T) = xs |> Seq.exists (fun o -> o = x) [<Extension>] static member inline NotIn(x: 'T, xs: seq<'T>) = xs |> Seq.forall (fun o -> o <> x) providing usages as if s.In(["this","that","other"]) then .... if (["this","that","other"]).Contains(s) then ... etc.

Categories : Misc

which method is first called when a xaml page is loaded in windows phone by default?
To directly answer your question: Initialize is the event you are looking for. For more detailed information, Google is your friend: Application lifecycle - http://msdn.microsoft.com/en-us/windowsphonetrainingcourse_applicationlifetimewp7lab_topic2.aspx Controls and other objects should follow the standard event lifecycle: http://msdn.microsoft.com/en-us/library/ms754221.aspx

Categories : C#

Is there an equivalent method to C's scanf in Java?
There is not a pure scanf replacement in standard Java, but you could use a java.util.Scanner for the same problems you would use scanf to solve.

Categories : Java

Prototype equivalent of jQuery eq method
$('#fun li').eq(2); is equivalent to: $($('#fun li')[2]); So you can use native javascript to accomplish this. $($("fun").select('li')[2]).whatever

Categories : Javascript

Is there a get_form method equivalent for InlineModelAdmin?
Because those work with formsets. Override get_formset instead.

Categories : Python

C# method equivalent to Java's DirectByteBuffer
__declspec(dllexport) void floatOne(long av, int n) This is a serious bug in your code, the long type is 32-bits in 64-bit mode when compiled with MSVC. That isn't big enough to store a pointer. It will work by accident until you start allocating bigger chunks of memory. The proper argument type for "av" is a pointer type, at least void*. Of course there's no reason to avoid just declaring it float*. Code always work better if you don't try to fool the compiler. You must declare it as IntPtr in your C# code. What you are trying to do with the alignment is quite inscrutable. The requirement is that the address is aligned to a multiple of 16 for SSE2 code. You could use this helper method: static IntPtr AlignAddressForSSE2(IntPtr addr) { return new IntPtr((addr.ToIn

Categories : C#

Visual Studio 2012 XAML designer does not show correct content when App.xaml in different assembly
Know this is an old question, but answering it for anyone who may face something similar in the future. The safest way to accomplish this is to create a new ResourceDictionary file, and add the MergedResourceDictionaries in it. Then reference that ResourceDictionary in your user control/pages/windows - all of them, since the <UserControl.Resources> <ResourceDictionary Source="GlobalResources.xaml" /> <UserControl.Resources>

Categories : C#

how can i take that page1.html paeg from mainpage.xaml to secondpage.xaml and show on webControl browser?
So finally i have a proper answer for my question. my requirement was take values from isoalated Storage form Mainpage.xaml and show on SecondPage.xaml's web-browser control. And this all i wanted on selection a image from ListBox control which is set on the MainPage.xaml. So code is following along with inline documentation i have mentioned to making out the scenario. **//MainPage.xaml.** private async void imgBookImage_Tap(object sender, System.Windows.Input.GestureEventArgs e) { //It is the way to take the id from the listView if you are showing your listView through Wrapper using ObservableCollection. myWrapper bookName = (myWrapper)this.listCloudBooks.SelectedItem; IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication(); string dir = "/MainFolder

Categories : C#

Equivalent method to "Reset to Match Style"
After 2 days of developement, I have solved my issue. It was not obvious because the Api is not clear with that. You have to use the Paste method of your chart Object which is inherited from _Chart. Here is the Api link : http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._chart.paste(v=office.14).aspx

Categories : C#

Android SDK equivalent method for MPL PayPalPayment.setPaymentType()?
Jeff from PayPal at your service. No, modifying payment types is not yet supported. However, please keep an eye out, as we plan to support this sometime in the not too distant future! Your best bet is to continue using MPL until it become available.

Categories : Android

The equivalent of C# consuming a WCF method in JavaScript (jQuery)
Look into Jquery SOAP .. http://plugins.jquery.com/soap/ etc. haven't tried it myself but it's the kind of thing you might be needing here.

Categories : C#

javascript equivalent to jquery trigger method
Once I crossed this site How to Manually Trigger Events in JavaScript // Here is a VERY basic generic trigger method function triggerEvent(el, type) { if ((el[type] || false) && typeof el[type] == 'function') { el[type](el); } } // We could call this on multiple objects at any time function resetFields() { triggerEvent(document.getElementById('has-email'), 'onchange'); triggerEvent(document.getElementById('other-field'), 'onclick'); triggerEvent(document.getEleemntById('another-one'), 'onblur'); }

Categories : Javascript

.Net equivalent of Java 'Collections.disjoint()' method?
It sounds like you're just looking for the LINQ Intersect method: bool disjoint = !collection1.Intersect(collection2).Any();

Categories : C#

Cannot locate resource workflowdesigner.xaml When creating XAML Workflow Activity in Visual Studio 2010 using CRM 2011 SDK
That is a known bug. I contacted Microsoft and they confirmed it. I was told to look for a fix in UR 17. UR 16 was released in January so it should be out "soon". Update Rollup history: http://support.microsoft.com/kb/2555051/en-us (I realize this is a late reply, but it was a recent issue for me.)

Categories : Visual Studio 2010

Equivalent java script function for ASp.Net method web.DownloadString()
There's no such equivalent in javascript because of the Same Origin Policy restriction built in browsers which prevents you from retrieving resources on other domains. But assuming you could overcome this restriction (with techniques like CORS) you could use AJAX. Alternatively you could setup a controller action on your domain which will act as a bridge -> this action will retrieve resources from remote domains using a WebClient and then you could use javascript to send an AJAX request to this controller action.

Categories : Javascript

REST equivalent for a isVerb kind of method (boolean response)
In my opinion '/verbs' path is very good in this scenario. But if it already has been taken consider something similar, for example: '/verbsResource', '/versSet', ... This service will return (for GET request): status code HTTP 200 OK when given string is a verb; status code HTTP 404 Not Found when given string is NOT a verb. So there are no boolean values.

Categories : Api

From XAML to C#. How to add DataGrid to WrapPanel that corresponds the one in XAML?
I'd probably create a Style with the properties set up, then use that for both myDataGrid and myDataGrid2. E.g. something along the lines of: // in current file's Resources section <Style x:Key="MyDataGridStyle"> <Setter Property="BorderBrush" Value="{x:Null}" /> // other stuff... <Setter Property="Columns"> <Setter.Value> <DataGridTemplateColumn Width="10"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <CheckBox VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding Path=one, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" /> </DataTemplate> </DataGri

Categories : C#

Reference not found in xaml but present in xaml.cs
Take a look here, that might help you maybe : http://msdn.microsoft.com/en-us/library/6taasyc6(v=vs.80).aspx Hope you'll fix your problem !

Categories : C#

What is the easiest method to implement(draw) 3d plot/scatter, the equivalent of plot3 from matlab?
ILNumerics is quite easy to learn. It combines a mathematical engine with visualization capabilities (providing Windows Forms Controls). I've posted an example here: Creating a 3D Scatter Plot in C#

Categories : C#

Use xaml canvas in main xaml
use this example: How to Use This StackPanel as a Resource only instead of stackpanel put your canvas: <DataTemplate x:Key="MySuperBanner"> <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="LynxLogo" Width="673.152" Height="408.613" Clip="F1 M 0,0L 673.152,0L 673.152,408.613L 0,408.613L 0,0"> <Canvas x:Name="Laag_1" Width="799.785" Height="599.567" Canvas.Left="0" Canvas.Top="0"> <Path x:Name="Path" Width="20.38" Height="26.328" Canvas.Left="260.39" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 272.361,372.544L 268.799,372.544L 268.799,349.571L 260.785,349.571L 260.785,347.006L 280.375,347.0

Categories : C#

httpcontext current server mappath shows c:inetpubwwwroot when the current location is somewhere else
Use Server.MapPath("~"), which returns the physical path of the root of your application. The Server.MapPath("/") you are using, returns the physical path of the root of the domain.

Categories : Asp Net Mvc

StreamReader Server.MapPath - Physical path given, virtual path expected
MapPath translates paths starting from ~ to full local path. Does not look like you need it in your code. If the file is supposed to be at fixed place all the time, open in directly by full path. If it is relative to site root, then use something like Server.MapPath("~/status.txt")

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.