I would like to create another page with statistics about the usage of my ASP.NET project. Top page visited, etc, etc.
I wonder if it is possible to use LogParser to create the graphic images of the page?
The following use-case comes to my mind: Select startDate and endDate and use them in a LogParser QUERY to select top user, hours with most traffic, etc, and output this query as an image with a chart in it.
Is this feasible to do on server side?
Thank you for your time.
Sure it's possible, you can use the CHART output format to save a chart to a gif or jpg, and then include that image in the page.
Related
We are using an older character based version of QAD's MFG/PRO running on Progress version 10.1. On one of the shipping tables, I've to create a browse that will display all records in a scrollable browse (sort of infinite scroll browse). It will display first 10 records initially, but user will be able to scroll up or down in the browse, which should load previous or next record (up or down arrow key).
I was wondering how something like this can be achieved. Preloading a temp-table with millions of records doesn't seem like a good idea, querying the database for every up or down arrow key press sounds equally bad. Does DEFINE BROWSE provides a way to achieve this? Is there a way to code lazy loading type scenario?
Also, how the scenario would change if instead of a browse showing data from a single table, will combine data from multiple tables?
Any help/pointers in this regard will be helpful. Also, if some best practices can be shared.
You can look at the END and OFF-END events in the browse widget. This will alert you when the user wants to scroll forward/backward. The query associated with the browse also has an OFF-END event that you could look into using for this.
Doc at https://docs.progress.com/bundle/abl-reference/page/High-level-widget-events.html#High-level-widget-events
How to upload multiple images to the web server with single button.I know there are couple of options available like flash,j query and silverlight.The problem is that there are many others things I want to do with images like upload the same image with different size (thumbnail) and want to change the image file name something like a GUID and want to store the path in database.
You can use uploadify.js for the same.
It is light weight as it contains jquery code.
Easy to implement.
Here is the link for the same. Uploadify
I have a column in my database that stores images that are links, when i populate them in a gridview on my asp.net page I want it to display the image as a link but when i did it i just get the text below.
<img src="http://www.url.com/url/url/url/url.jpg">
My goal is to have a list of the images and when a user clicks the image they will go to another page. This is a start of my page, and i was attempting to use a gridview but now I am not sure what to do
Don't save markup
Instead just save a URL. In your case two of them since one points to *.html and the other to *.jpg. Or just without extensions if they're always the same except for the extensions. This way you can easily change your markup later and still use the same data from the DB.
But apart from this fact of not saving non-data in DB you could at least provide some relevant code you're using. We'd much easier tell you where you're doing it wrong.
Using GridView
The problem you're having are column templates. Check this link out and see how you can customize the display of a particular column in a GridView. Essentially you will have to provide your own template and do whatever you please with your DB data.
To create dynamic charts and graphs in ASP.Net, I have placed the (GDI+) code for each chart in separate page files – so the output from running a chart page by itself if to just display the chart onscreen.
The chart page contains the code to get the relevant data from SQL Server, as well as the chart generation code. The generated chart object is then saved to Response.OutputStream.
A content page where I want to display the chart provides various parameters to determine what data will be used to generate the chart (such as userID, project ID, selection from dropdown lists etc.).
To display the chart as part of a content page, I then place an image object in the page, collect the various chart parameters, and in code behind set the URL of the image object to be the chart page, plus all the chart parameters added to the query string.
This works fine, except for one thing: when I right click on the chart image as it appears in the content page in the browser, I get an option to “open image”, which displays a page with the chart all by itself (perhaps not surprising as it is generated with a chart page). However, the problem is that in this chart page, the full URL with the querystring is visible, which means that a user could change the values in the query string, and thereby generate a new chart. This is a big problem, as it might enable a user to generate a chart for data they should not have access to.
Is there a way to avoid this problem whilst still using this “chart page” approach to generating and displaying dynamic charts? Alternatively, should I rather save the dynamically generated images as files, either on disk or as SQL Server Filestream objects for example, and then reference these in the page?
By the way, I am aware of the various ASP.Net chart controls that are available. However, the charts I need to generate are highly customised to a very specialised application, so those controls will unfortunately not work in this instance.
I have the same concern for one of my previous projects. One cheap but not 100% fool-proof solution is to insert a http-referer check before you process the image. Images loaded from within you page will have the referrer URL of your domain, those entered directly via the browser won't have.
Of course it's very easy to hack by faking referrer url, still it is some form of deterrent. Will be glad if others can offer their solutions.
Another way is to add some sort of checksum params into your querystring. Only you know how to 'decrypt' and only generate image when the checksum is 'correct'.
First of all, I assume that your users are authenticated (logged in) to your website, so you know who they are and what data/charts they are supposed to have access to?
You need to check the incoming parameters in your image-generating code to see if the current user has access to the data he asks for. Typically you would query your user/privilege tables for this (or call the Membership API or whatever).
Trying to hide the URL (for example by doing a POST instead of a GET to the image-generating page) is just "security by obscurity", which is not a good idea.
By the way, your problem is called "URL tampering", a Google search for this should get you in the right direction.
I need to show a Line Chart on an ASP.NET page where each data point has a tooltip that shows its exact X and Y values. A chart for a particular dataset will probably only ever be requested once, so caching is disabled and the chart will be regenerated if it ever needs to be shown again.
Restrictions:
Needs to work in a web garden environment
Cannot use Session
Cannot use rich media, such as Flash or Silverlight.
The approaches I've seen used an image map for a generated chart image. Due to the restrictions, all of my charts so far have been generated in a handler in memory, streamed directly back to the user, and then disposed of. Now I need to add tool tips, which would requires both HTML and an image.
My current plan is to generate the chart once on the page to get the HTML, ignore the generated image, and rewrite the "src" of the image tag to point to a second page. The second page generates the same exact chart as the first, ignores the HTML markup, and streams the image back to the client. This all seems very kludgy.
Is there an better way to do this that doesn't involve generating the chart twice?
Available chart controls:
Dev Express 8.2
Syncfusion 6.2
?? - Recommend something
What about using the Google Chart API, and a .Net wrapper? See this SO discussion for more information.
I solved this by using the MS Chart Control. The disk handler can share images across servers in the web garden and automatically cleans up after itself.