Asp.net Chart control in SharePoint 2010 - asp.net

Can anyone help me in storing Chart control's temporary images in SharePoint 2010 Document library/Picture library? Whether it is possible or not ? Actually want to use a webpart with Chart control in it, in a load balanced environment.

I think I got a answer for my query, to store the chart images in SharePoint document library we need to map a document library to a hard disc drive (as I did z:) and then set the chart image handler as: for this to work porperly we also need to change the script manager's async postback timeout property to 3600 as AsyncPostBackTimeOut="3600". The process is taking around 3 minutes (as it first creating the chart images in document library and then downloading those) in my environment which is bit high for the users to wait that much long :( so again searching for some methods that can make the process faster. Hope this can help someone.

The information in the document library is stored in the database so there should be no issues with keeping images there across a load-balanced environment.
The images in a document/image library are all URL accessible resources so you should be able to populate ImageLocation property of the chart control and set ImageStorageMode to ImageStorageMode.UseImageLocation.
Encapsulating that in the web part should not make any difference than a user control. You may elect to provision the image library and the web part in the same site coll feature.

Related

How to design a website when its content layout needs to be changed all the time?

Our team is building a new web site with ASP.NET. We plan to use a 3-tier architecture. The problem is that the controls shown on the web page need to be changed all the time according to the customer's requirements, which means adding a pair of label/textbox, or removing a pair of label/dropdownlist when the customer needs it. So the layout needs to be flexible and allow to easily add or remove controls, although it just shows some simple product messages like price, discount, tax, etc.
The previous version of the web site saved all the control information in a database, like control name, control type (textbox, label, dropdownlist), which page and panel it belongs to, etc. You can see there is a big performance hit because every time there is a request to this page, it needs to get all the required controls from the database and add them to the page manually, no matter whether the request is a postback or not.
We thought about adding the controls directly to the .aspx page, but in this case it will be difficult to change them later. We also considered holding all the controls' information in XML files, which may give a little performance advantage, but it still needs to render the controls all the time.
So this is the problem we have, to improve the app's performance and also meet the users' needs at the same time. Could anyone help me with any solutions or ideas?
PS: you can also ask questions if I didn't make it clear enough. Best regards.
This sounds like a good situation for User Controls. If all you're doing is toggling child-control visibility, then creating a user control with toggleable visibility properties should meet your needs. You can still use your backend to toggle visibility, but you'll only need to pull yes/no flags from the db instead of entire page schemas.
From an architectural standpoint, User Controls are great because they encourage modularity, code reuse, and lend themselves well to version control (UsercontrolV1.cs, UserControlsV2.cs, etc). The point on version control is especially great in cases where change requests require logic updates, or simply need to revert to a build that existed x iterations ago.
Now that is what i call a Flexible web-Application.
the controls shown on the web page need to be changed all the time
Who will change the controls? The client? Can you not just update the .aspx file and publish it to the server every time a control is requested to be changed?
but any way, its an interesting question. There is nothing else really that can be done except using a XML file.

How can I open an iframe on the asp page behind my Silverlight 4.0 Application without it being visible

My application uses MVVM architecture and needs to occaisonally call some outside asp pages to interact with a few other systems. The problem is I that I really don't want the user to see these pages because they don't have a UI, they really just need to open in the background, perform their function, then close, all without ever being seen. I can not use windowless mode. The URL that I need the frame pointing to is generated in the viewmodel so I also need to know how to get that info to the frame. I'm really lost on this issue as there isn't much online related to doing this without windowless mode. Any help would be much appreicated.
See these two for references in how I pieced the code together for this.
Silverlight, can I access DOM elements in Webbrowser control?
http://www.davidezordan.net/blog/?p=700
Note that the only thing you can do is set the value of the url for that frame if it is in a different domain because of security reasons. That may be fine for you. So try something like:
var element = HtmlPage.Document.GetElementById("yourIframe");
element.SetAttribute("src", yourUrl);

Asp.Net - how to build and customize a calendar?

I was commissioned to build the following:
Web app to be accessed by all mobile devices - so no Flash/SilverLight/HTML5...
Main page will contain a calendar of current month (ability to navigate to other months is not required)
Each day should display one or more jobs (I am thinking 2 lines of text for each job), and each of these jobs may have a different color, depending on the time.
Database is SQL Server, hosted on GoDaddy, on the same hosting account as the page will live.
I am a newbie in web development and I would like to get some guidance of the best/easiest approach to implement this. Since I am a .Net Windows developer ASP.Net (or MVC) would be the preferred technology (unless you recommend a different one for this problem). I would really appreciate specific help on things like what control to use? Should I create a grid/table manually? How to customize each day's content, so it shows multiple jobs, each job being a couple of lines of text, but with specific color according to the job type?
(in WPF I would use templates, converters for color and everything data-bound. Do these things exist in Asp.Net?)
Thank you so much for your help!
Those links might help you:
Some javascript/JQuery calendar: http://www.webdesignbooth.com/9-useful-jquery-calendar-and-date-picker-plugins-for-web-designers/
A databound templated calendar control for Asp.Net: http://www.codeproject.com/KB/webforms/MellDataCalendar.aspx
You might look at jquery UI calendar or Telerik extension for MVC. It's not "fancy" but javascript.

Showing a form from a webpage

I have a problem I am trying to solve in an elegant manner. I have a .net application that I have created. I am trying to get one of the forms to be shown from a webpage. This sounds strange I'll admit, so here is the backstory
We have some large monitors at work, that show information on them. I have no control over how the information is displayed. Currently they are just using a browser and tabbing in the browser to show each different piece of information on the screen. Most of the info they show is just standard html stuff, text and images.
Now along comes my winforms application. The part of the application I need to show is a graphical display. Everything on this display is drawn using GDI+, if that matters. I need to get this form into a format that I can show. Below is my own solution, but I am pretty sure this is not the best method, but it may be the only method I can use
Create a console application. The application would do the following
1. Run as a service on a server
2. Create the display in memory, and save it to a bitmap every so ofter
3. Save the bitmap to a location on the network.
4. have an HTML file that links the image that can be shown in the browser
I though about doing something with the clients, however the clients are not always up, so I could have periods where the image wouldnt be updated.
I also was thinking about an ASP.net solution, but that would require me to learn ASP.net, and I am not quite ready to take that challenge
In IE you can host a winforms app/control as an ActiveX control, like so:
<object id="DateTimePicker" height="31" width="177"
classid="bin/Web.Controls.DateTime.dll#Web.Controls.DateTime.DateTimePicker" VIEWASTEXT>
</object>
See this article for more information: http://www.codeproject.com/KB/miscctrl/htmlwincontrol.aspx
Now, I'm not claiming that this is any more elegant than your solution, but it is an alternative.
I think using Asp.Net to serve a dynamic image using a HttpHandler would be the best approach, but depending on your skills and time this may not be an option. Here is a nice tutorial: http://www.codeguru.com/columns/dotnet/article.php/c11013
IMHO The best way to build this would be as a browser plug-in, like how Flash works. Microsoft has created a plug-in framework called SpicIE, that allows you develop managed plug-ins for IE. This is probably your best bet.
The old unmanaged way is to build out your WinForms dll app and then package it in a signed cab file, and then reference that cab file with an HTML object tag (codebase arg is the one you need).
i.e.,
document.write("<object CLASSID='clsid:DC187740-46A9-11D5-A815-00B0D0428C0C' CODEBASE='/MyFormsApp/MyFormsApp.cab#Version=1,00,0000' />");
The first time the user hits the page they will be asked to allow for the installer to load its payload (dll's). Once they do, they will have a fully fledged WinForms desktop APP running through a browser window.
I took the easy route on this one. I created a small winform app, that coverts the GDI objects to a bitmap, and then I save the bitmap to a network share. This file is refenced in a simple HTML file that is displayed on the monitor.
I chose the winform app, because it makes it really easy for me to set this up in task manager, and run it every 10 minutes to update.

How to make Flex RIA contents accessible to search engines like Google?

How would you make the contents of Flex RIA applications accessible to Google, so that Google can index the content and shows links to the right items in your Flex RIA. Consider a online shop, created in Flex, where the offered items shall be indexed by Google. Then a link on Google should open the corresponding product in the RIA.
Currently the best technique for making an RIA indexable by search engines is called progressive enhancement (or graceful degradation, depending on which way you see it). Basically you create a simple HTML version of the application using the same data as the application loads. This version should be dynamically generated by some kind of backend server technology. This HTML version can be indexed by Google, but each page also contains a check that determines if the visitor is capable of viewing the rich version, and if so replaces the HTML content with the Flash, Flex or Silverlight application, preferably in such a way that the application starts in a state where it shows the same data as the current page. "Replaces" can mean that it just embeds the application on top of the HTML content, or that it redirects the user to a page that embeds it. The former solution is preferable, because the latter can be considered cloaking.
One way of keeping the HTML and RIA versions of a shop synchronized is to decide on a URL scheme and make sure that RIA uses some kind of deep linking technique. If a visitor arrives to a specific item via a search engine, say /items/345 the corresponding pseudo-URL in the RIA should be the same, so that you can embed the RIA on top of the page and set that URL as a parameter to make the RIA display that same page as soon as it has loaded.
This summer, Google and Yahoo! announced that they would begin using a custom version of Flash Player to index Flash based applications by exploring them "in the same way that a person would". Now, two months later there is still no evidence that this is actually happening. Ryan Stweart had to cancel his Flex SEO competition because it became evident that no one could win. The problem seems to be that event though the technique may very well work (although I'm sceptical), the custom Flash Player needs some kind of network interface to be able to load any referenced resources, like XML data, other SWFs, etc., and this is currently not implemented by Google. This means that for an application that loads all it's data dynamically, like say, all that I can think of, Googlebot will not actually see anything relevant. Yahoo! ignores SWF based content altogether.
Oh, and it just so happens that I talk about Flex and SEO on the latest episode of the Flex show =)
There is a massive thread available here:
http://tech.groups.yahoo.com/group/flexcoders/message/58926
But essentially, google already indexes .SWF files (you can test this out yourself by restricting search results to just .SWF files). It can search any text content within the SWF file.
However, if the text information in your site comes from a database / web server. Then it won't be able to access this information easily.
One example of getting this to work is using an XML file as your index page, then using an XSLT transform to render it using Flex. "Ted On Flex" has good information about this.
http://flex.org/consultants

Resources