|Render Charts.js on backend side asp.net|
The below is some code I've used in a similar situation, which takes
some html and produces an image of it (cropping whitespace). I'm not
sure when in the page lifecycle Chart.js draws it's charts however so
this may not work. You could adapt it to load an actual page rather
than passing in HTML.
Not pretty, not platform agnostic, and could have varying results
depending on versions of IE etc. (e
|Place a footer with bootstrap in Layout-Page?|
I do this as on the getbootstrap.com:
Here is my example:
/* Wrapper for page content to push down footer */
height: auto !important;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
|Save as Image on the iPhone|
Short answer, NO.
You will have to instruct the user to save the image. But you can use
a Passbook file, which your server can create, to allow the user to
save the coupon.
You can read more about Passbook here:Passbook Programming Guide
Apples simple Passbook example: Building Your First Pass
|Capture ALL WebAPI requests|
I would just hook into web api tracing...
From the above article, you can implement ITraceWriter like so. This
example uses System.Diagnostics.Trace.WriteLine, but you could plug in
writing to a file here as well.
public class SimpleTracer : ITraceWriter
public void Trace(HttpRequestMessage request, string
|Web deploy with MSBuild deploys only BIN folder|
What do you mean with the "rest of the website". Typically all your
website assets are compiled into binaries and deployed like that.
If you wish to deploy additional files you can do this in the publish
settings in your project properties:
|Response.Write and postbacks in ASP.NET|
It depends on when you call it in the page life cycle. The output can
end up anywhere on the page. I don't recommend using Response.Write()
in ASP.NET. Instead, use a server control like asp:Panel, asp:Literal,
|MiniProfiler not logging all steps - only with active breakpoints|
Click show trivial - I suspect the ones you're not seeing are
"trivial". When you hit the breakpoints, you make them appear
not-so-trivial by increasing their execution time.
... as I was poking around their code I stumbled on this
public bool IsTrivial...
|mono ubuntu Runtime Error A runtime error has occurred|
A quick search using Google reveals:
Basically you need to adjust a few other settings
|generate dropdown using values from another table in asp.net. vb mvc 4|
Either you can add one more property as a collection of the same
model, or you can fill that collection in a ViewBage and use it the
same at your view.
ViewBag.DropDownCollection = "Collection"
|IIS Reset itself make request to crash|
Here can you read up how recycling works:
Here is how you can schedule when the pool should recycle:
That might fix you issue in the short run!
In the long run you should write the service so that is can recycle
without affecting the consumers of the service. If your
|Is it possible to do unit-test ASP.net MVC views without precompiling the views?|
You can render Razor views standalone using RazorEngine or one of the
solutions here. This will give you HTML which you will have to parse.
However, the reason you haven't found any examples of testing views is
that few people do it. Views are declarative; they don't have logic.
It takes time and effort to develop a test strategy for views. A
better strategy might be to move any logic contained
|Is it possible to use jquery ui controls instead of web controls in asp .net web forms?|
You can use any controls you want. However, non asp.net controls will
not postback to your server. You will need to manually call the
you controls will be wired to do postbacks using the built in asp.net
mechanism, you will need to force your page to generate that code for
you by calling something like this:
var cs = Page.Client
|Accented characters of a vCard not displaying in Windows Contacts|
Just because you add a "CHARSET=utf-8" parameter doesn't mean the
value will be written in UTF-8. You are probably not setting the
character encoding to "UTF-8" when you write the vCard.
Also, note that vCard version 4.0 does not support the "CHARSET"
parameter. The specification states that all vCards MUST be written
|How to indicate the start and end of thread in asp.net|
You need to check if an Invoke is required with
Me.Label1.InvokeRequired and in case it is needed you Invoke a
function to set the text.
Full example here: Make Thread-Safe Calls to Windows Forms Controls
|asp.net codebehind auto file open in frame|
It may be that your browser isn't recognizing the type of script to
run, or that the pdfPath isn't being passed to the method. Could you
first build the script literal then print it, to ensure you're passing
the correct value?
Also, perhaps it should be:
pdfPath + "')</sc
|Pass User info to WCF Web service with WCF method vs with Soap header|
I believe it's better to pass some kind of user ID in a header of
every message you send to your WCF service. It's pretty easy to do,
and it's a good way to get info about user + authorize users on
service-side if needed. And you don't need 4000 instances of
webservice client for this.
You just need to create Behavior with Client Message Inspector on
client side(and register it in your config).
|change Microsoft exchange calender from ASP.net page|
one can edit the exchange calender by sending an appointment email to
the client. this seems to be the most proper way to change one
|My ASP.NET results are different|
In the test/Default.aspx example, you are creating a web request that
is originating on the server, hence the "runat='server'" parameter.
If you are trying to create an ajax request that originates from the
You could use jQuery to do this by doing something like:
|What is the best way to update database on 00:00 everyday in asp.net mvc4|
Check out Hangfire. Scheduled tasks in ASP.NET. Super easy and
We just started using it and I like it.
|Salted Password Hashing. Am I doing it right in ASP.NET environment?|
Rather than deal with all these issues, why not use the built in
identity management tools provided by ASP.NET. See here
Much more common and robust.
|Retrieve from html body|
I suggest you to have a look at HTML parsing libraries like
HtmlAgilityPack or CsQuery
Here is how it's done in CsQuery (the selector syntax is compatible
Dim html = "<html><body><div style=""color:#000;
background-color:#fff; font-family:HelveticaNeue, Helvetica Neue,
Helvetica, Arial, Lucida Grande,
|Wiring up ASP.NET Web Application using Forms Authentication with SqlMembership Provider on Azure|
Thanks to Simon W above, I found my problem. In the Azure Portal,
there is a setting that controls "Azure Websites Authentication /
Authorization". Its found under Websites, then Configure, then scroll
down a bit to "Azure Websites Authentication / Authorization". In my
case there was an entry there: my website was tied into the
"Directory" for my account and the "application" was set to my "te
|Clear Required Field Validation Group|
You are doing the validation wrong. First of all ValidationGroup is
used to group validations so in a button click you validate the fields
in that group. All server controls have this property so that you
could group them together for validations by using the same text in
this property. Checking the value in this property will not indicate
that your values in your controls are valid or not.
|IIS recycles site every time a css file is modified|
IIS should not restart because of a CSS edit. Modifying the
web.config file is usually what triggers a recycle. Also, possibly
modifying the contents of the Bin folder.
Also, check out What causes an application pool in IIS to recycle?
|Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. Enterprise Library|
I can see many actions happening once Reader is open. If any
exceptions raised on dependent function like : myNav.Categories =
GetCategoriesCollectionFromReader(reader); can keep the reader open.
Safe side exclusively close the reader. like this:
public static NavigatorEntity GetNavigator(int navigatorID)
Database db = DatabaseFactory.CreateDatabase();
|Stored Procedure works fine from SQL Mgt Studio but throws Invalid Object name #AllActiveOrders from MVC app|
Stored procedures and temp tables generally don't mix well with
strongly typed implementations of database objects (ado, datasets, I'm
sure there's others).
If you change your #temp table to a @variable table that should fix
(Apparently) this works in some cases:
IF 1=0 BEGIN
SET FMTONLY OFF
Although according to
http://msdn.microsoft.com/en-us/library/ms173839.aspx, the f
|ASP.NET Linkbutton not getting dynamic value for commandargument value|
The output of Tag "<%= %>" is more likely similar to use
Response.Write in your code. so these tags are used to display the
value to the response object.
That's why,as per my understanding, You can't used these tags to set
commandargument property of controls unless you are using DataBinding.
If you are using DataBinding then these tags "<%= %>" are used
to set the property of contro
|Difference between AJAX Helper and async/await|
They are actually completely different. The key to understanding the
difference is to think about the HTTP protocol.
In the HTTP protocol, you have one request and one response. That's
it. The client makes a request, and the server creates and sends a
When you use async and await in a request handler (such as an MVC
action), you still only have one response. async doesn't change the HT
|ASP.NET Protecting Pictures Directory from Anonymous Users|
As a new user of IIS, I didnt realize that I had to add a handler to
the server configuration to make it 'see' jpg's in order to enforce
the setting in the web.config.
If anyone else comes across this question, placing a web.config file
in the directory you wish to protect does work, but you also need to
add a 'Handler Mapping' for the file types you are trying to protect
otherwise IIS will just
|How to update structure of database with Entity Framework Code First without losing all data?|
You can use Entity Framework Migrations and run the update-database
command in order to generate a T-SQL script that you can run manually.
This gives you a bit more control on the changes applied to the DB.
Alternatively, you can trust EF to do it for you. You can find all the
necessary ef migration commands here:
The link I provided had a s
|Tying up angular controller to view|
In your js (pointofsaleController.js) you currently have:
var controllersModule = ng.module('pos.controllers');
Which is getting a module, not creating one, in order to create an
angular module you must use:
var controllersModule = ng.module('pos.controllers', );
Since you have your controllers in a separate module you will need to
inject that module into your app module which wou
|Storing ASP.NET Session across multiple SQL Server Databases|
How well would the rest of your app perform if the database was down?
This question is really about high availability of the database. You
could add failover clustering to your SQL Server, which can get
expensive. Or you can store your session in a distributed cache, such
as memcached, redis or AppFabric.
|How to create a Custom control with controls inside of it so I can repeat it 25 times on webform|
Define a Repeater or ListView with the ItemTemplate of what you
desire. Bind to it 25 blank rows, and this will appear as you desire.
On save, you can loop through the rows to get the control values.
|How to display multiple images in a new window using popup from dtabase in asp.net?|
You have to make a page that will show one image at a time.
Then you will update you asp.net code similar to this (you could
improve this, VB.net is not my strongest point):
Const SQL As String = "SELECT @ImageType FROM [NewCus] WHERE [Cust_ID]
Dim myCommand As New SqlCommand(SQL, myConnection)
|Orchard CMS localize arbitrary text|
You can use the Orchard localize helper to display localized text in
your views. The helper is simple to use: <label>@T("My localized
text")</label>. Then you add the localized text to the po files,
either in your module or in the site's po file.
|IIS URL Redirect works, but Rewrite throws 403 forbidden error|
It's not possible to rewrite to another URL (or another Application
Pool). Only redirect will work in this case.
Edit: Technically it's possible, but not the way you've implemented
it. If you want to rewrite to another URL, you'll need to implement as
a reverse proxy using the Application Request Routing (ARR) module in
|why my ajax control doesn't work, even no error?|
You can replace the scriptManager in the page with
This will certainly solve your problem.
|Web Api 2: NotFound() with content?|
According to RFC2616 Section 10 the 404 does not return any
information about the resource itself.
But if you want to use the 404 you can use this instead:
return Content(HttpStatusCode.NotFound, "Your Content/Message");
|Hide Gridview column when null|
yes u can dynalically create the boundfield values
from code behind based on your requirment
follow this link
add boundField to gridview in codebehind file C#