C# - Creating A Web Wrapper For COM And OCX?
Mar 17, 2010
Today we have a windows application that, using an OCX, creates a web page (visible by a WebBrowser control in a small .NET WinForm application) and communicates through COM to the main application/client. (not relevant but this is Pascal)
I'm currently responsible to re create this application in a web environment so we can have the same functionality shared through Web as the user can see the same in a Web Browser.
The Windows application has almost 4 years on it and I need to re create everything from scratch, and all the bugs/features find in the future in the Windows Application I have to re create them again in the Web...
is there any way I can create a Wrapper, even using 3rd party commercial objects, to:
Communicate with the COM Object Can expose the content of the OCX (this in my most confortable language, ASP.NET C#, but other are welcome) I was thinking out loud, can this be accomplish with a Java Applet? Silverlight 4?
View 1 Replies
Similar Messages:
Feb 8, 2011
I'm trying to create a SessionManager class which I can use to manage sessions in my MVC applications. For that I'm thinking the best way of doing so is by creating a wrapper class for HttpContext which would then allow me to access HttpContext.Current.Session.
To be honest, I'm not really sure about the whole thing, I just feel it's the logical way of doing so. I also want to create an ISessionManager and ISession interfaces, and then implement them according to my application's needs. For my current project, and for now, I need a InProc session management, but I might need to store session data in MSSQL Server when we decide to expand and use a web farm or a garden. That's why I'm trying to build a sort of an extensible framework right from the start.
Final note, I will be using Microsoft Unity to inject the concrete SessionManager of choice. I believe that's a good way to maintain a certain level of abstraction.
View 1 Replies
Oct 15, 2010
creating dataset wrapper in c# with sample code..
View 3 Replies
Nov 8, 2010
I wrote a webmethod (Called SearchData()) in which the method makes a httpwebrequest to another url and gets the data in xmldocument. After getting the xmlDocument ,it is returned to SearchData method invoker. When i invoke the from browser it works fine. But When another application in java tries to consume this webmethod SearchData(), it is getting the error
<wsdl:part name="Body"/>
and each part should be type defined. The WSDL file is not well formatted. it doesn't have Type defined at each element. How to fix this.or Is there any other Better way to provide the end user the xml(ie from httpwebrequest result in webmethod ) with a soap wrapper ie with a well defined wsdl. My code :
[Code]....
View 1 Replies
Nov 24, 2010
I have a third party dll and i need to add some more functionalities (methods, constants etc..) so create a wrapper class. I have no idea about wrapper classes. what is the purpose of this and how to create in .NET for this 3rd party dll.
View 6 Replies
Jul 15, 2010
I have this CollapsiblePanelExtender (below) the problem is that in firefox it gives a horizontal scroll bar under the control which has to expand.
[Code]....
Below is the generated HTML
[Code]....
If I remove the "overflow-y:hidden" from the generated div then the scroll bar goes away, which is what I want....
View 3 Replies
Oct 5, 2010
I am a REST web service newbie, does visual studio, .NET, or some other nifty microsoft tool provide any easy way to auto generate classes to consume a REST web service? With REST services is there even a service definition like there is with SOAP (WSDL) beyond the printed documentation? There is a new service that I'd like to consume but they only wrote wrappers for PHP, Pearl, Ruby, and Java and have more or less said you are on your own with .NET. I could write it myself but I'd like to cut corners and save time wherever possible.
View 1 Replies
Aug 13, 2010
I've seen how to Fake the SessionState object in MVC using Scott Hanselmans MvcMockHelpers, but I'm dealing with a separate problem.What I like to do is create a wrapper around the Session object to make objects a little more accessible and strongly typed rather than using keys all over. Here is basically what it does:
public class SessionVars{ public SessionVars() {} public string CheckoutEmail { get { return Session[checkoutEmailKey] as string; } set { Session[checkoutEmailKey] = value; } }}
So that I can just do this in my controllers and views:
SessionVars s = new SessionVars();s.CheckoutEmail = "test@tester.com";
Now the problem comes in when I want to write unit tests, this class is tightly coupled with the HttpSessionState. What I can't figure out is what is the right class to accept/pass so that I can pass in a FakeHttpSession into the SessionVars class. I've tried so many things with this, and this (below) will compile, but it can't cast the HttpSessionState into the IDictionary. I've tried ICollection, HttpSessionStateBase.
public class SessionVars{ public SessionVars() : this(HttpContext.Current.Session) { } public SessionVars(ICollection session) { Session = (IDictionary<string, object>)session; } public IDictionary<string, object> Session { get; [code]...
I'm missing something big here. I feel like this is possible and that I should even be that far off.Furthermore, I'm confused as to whether I should use the IHttpSessionState, HttpSessionStateBase or the HttpSessionStateWrapper. What is the abstract type that I'd use for the session object inside my SessionVars class? What is the type that I pass into the constructor?
View 3 Replies
Mar 8, 2011
I am just trying to figure something out. At work we have alot of data access code Ex:
[Code]....
Pretty standard stuff really, but I was at a training course recently where the Developers insisted on wrapping code, that seemed nothing more than expose exactly the same functionality.
I was interested in your thoughts as to whether this was a good idea. So the above would inherit from a DbHelper class with some thing like:
[Code]....
These would just expose the same but maybe a bit more generic i.e. using DbCommand as opposed to SqlCommand.
View 1 Replies
Sep 25, 2010
Anybody seen any c# code examples for using Google site search to send a request to the Google search api and return the results in xml?
View 1 Replies
Mar 4, 2010
Not sure if I'm posting in the right place so please forgive meI have an ASP.NET C# application that connects to either a SQL Server or MySQL database depending on some value that is set in my project config. The issue I'm trying to avoid is handling the connections and queries separately. Ideally I would want to use a DB Wrapper class that can handle both SQL Server and MySQL.
View 8 Replies
Mar 18, 2011
When jQuery is applied to elements in an UpdatePanel, when the UpdatePanel refreshes, the jQuery is not applied to the newly injected HTML. This issue is resolved by using
Sys.WebForms.PageRequestManager.getInstance().add_endRequest() to register a function to be called when the AJAX request is complete: I've written a function that registers the function with add_endRequest, and also calls it at the same time:
Async.RegisterAndRun = function(callback) {
//register function to be run when an update panel request is complete
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(callback);
//also run the function right now.
callback();
};
Now all we need to call is Async.RegisterAndRun(AddFancyjQueryToMyHTML); or
Async.RegisterAndRun(function(){
AddFancyjQueryToMyHTML();
AddMoreFancyjQueryToMyHTML('with', 'args');
});
Currently it does what I need it to, and I never need to explicitly call add_endRequest which is nice.
View 2 Replies
Jan 19, 2011
I am using ASP.net with WebMethods to show data to the customer and save data entered by the customer.
My current framework uses javascript to create an xml with all of the values of all the html elements in de "div" (or other element). This xml is converted to a string and send to the webserver using PageMethods.
When I receive this xml (as a string), I parse it with my own XmlDataParser which does some security checks.
I need to parse the xml to an XmlDataParser in every PageMethod I use, and I also need to catch different exceptions (like exceptions that are thrown when data is validated) to show them to the user (=> The reason why is explained in one of my previous posts: [URL]
I wonder if it is possible to write a wrapper around the WebMethod, so I can parse the xml to the XmlDataParser in this wrapper, and pass it on to the code behind, and process exceptions that occur in the code behind?
View 4 Replies
Mar 10, 2011
I'm currently facing a performance problem with creating POCO objects from my database. I'm using Entity Framework 4 as OR-Mapper. The whole application is a prototype for now. Let's assume I want to have some business objects like classes 'Printer' or 'Scanner'. Both classes inherit from a BaseClass called Product.
The business classes exist.
I try to use a more generic database approach. I don't want to create tables for "Printer" nor "Scanner". I want to have 3 tables: One called Product, and the other Property and PropertyValue (which stores all assigned values to a specific Product). In my business layer I do create a specific object like this:
public Printer GetPrinter(int IDProduct)
{
Printer item = new Printer();
// get the product object with EF
// get all PropertyValues
// (with Reflection) foreach property in item.GetType().GetProperties
// {
// property.SetValue("specific value")
// }
return item;
}
This is how the EF model looks like: Works fine so far. For now I'm doing performance tests for retrieving multiple sets. I've created a prototype and improved it several times to increase the performance. It is still far away from being usable. I takes 919ms to create 300 objects who only contain 3 properties. The reason for choosing such DB design is to have a generic database design. Adding new properties should only be done in the business model.
Am I just being too stupid to create a performant way of retrieving xx objects or is my approach totally wrong? As far as I understand OR-Mapper, they are basically doing the same?
View 2 Replies
Jun 3, 2010
Say I have a class that wraps the Controller class:
public class MyController : Controller
{
public string SomeProperty {get;set;}
public override void OnActionExecuting(...)
{
SomeProperty = "hello";
}
}
Now in my site.master, I want to have access to the SomeProperty that I just set. How can I do this?
View 2 Replies
Mar 1, 2010
I have a gridview with some DB values, i want to turn that values into link, so the user can click them and get redirect to another page.
I got this:
[Code]....
this is to write the values from the DB and i want to add asomething like this:
[Code]....
How can i do that? someone can explain that to me?
View 10 Replies
Jul 16, 2010
new to creating a web site. I bought "Build your own asp.new 2.0 website using c# & Vb." and I'm using Visual Studio 2005.
The book seems good so far but I'm now having a problem. I think I need to use "User Sessions" but I can't get them to work. The code works fine using Applications but when I change to Sessions, when I go into a page the value is always null.
I need "using System.Web.SessionState.HttpSessionState" defined but there doesn't seem to be anything after "System.Web.SessionState".
I've tried using the counters example in the book but with Session I only ever get 1 coming up which is the reset value when the Session["xxx"] is null.
View 4 Replies
Mar 25, 2011
In my project I am using a repeater to display articles from a database. I would like to add a link button that calls an asp page and the ID for example the link for article ID "1" would be articles.aspx?id=1
View 4 Replies
Aug 3, 2010
This is my first steps with XML and I must send a XML by HttpRequest (Which is not a problem to me now). By I've a question about DTDs. According to the HttpRequest destination APIs, I must validate my XML using an External DTD whos located there (this is for Canada Post shipping : [URL]I know how to write / read XML, but not according to DTD... Is there a difference?Can someone tell me how and the easiest way to do that? I've look a good part of good post from Google and there's never what I'm looking for .ADD #1
Note : I know what a DTD for, and I can create one on my own with a plain text editor and basing the XML on the DTD, but I realy mean, is there a way to take advantage of DTD in C# (Creating an object or someting...)DD #2Add-on : Any of you guys already set up an application to talk to Canada Post API using webresque? Because I'm stunk! I send my request with my data and it never finish so never return response ... here is my code :
public oShippingResponse RetreiveShippingCost(oShippingInformations shipInfos) {
// Send request
WebRequest request = WebRequest.Create("http://sellonline.canadapost.ca");
XmlDocument xmlDoc = shipInfos.WriteAsXML();
[code]...
View 2 Replies
Sep 23, 2010
i m using asp.net mvc2 for my application. i have a view that accepts a model and renders its data in some format. i want this page to be converted into pdf file so it can be sent via attachment or created and downloaded on the fly. i have some success creating pdf with itextsharp library but they say it has very basic support for html and css. if anyone has rendered complex html pages to pdf using itextsharp or any other library plz share ur experience
View 1 Replies
May 24, 2010
As the title implies how can I create a new log file each day in C#? Now the program may not necessarily run all day and night but only get invoked during business hours. So I need to do two things.
How can I create a new log file each day? The log file will be have the name in a format like MMDDYYYY.txt
How can I create it just after midnight in case it is running into all hours of the night?
View 8 Replies
Jan 23, 2010
i am new to mvc and i am presently facing problem to create my own textbox, button etc and use it to store my data to database.
View 2 Replies
Nov 14, 2010
I'm working on a ServerControl (SuperFish Menu).Below is my codes.Menu.cs
[AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[ParseChildren(true, "MenuItems")]
[code]...
View 1 Replies
Sep 20, 2010
i am new programmer i am using visual studio 2005i am making a project it is a e commerce site 1. what guideline should i follow ? 2. what r de step i must take before creating de site ?
View 2 Replies
May 25, 2010
I am getting an asp.net site developed and need a program which will generate barcode's. So far all I have found is http://www.barco.delib.com/purchase/main.html#pricebarcodenetweb . open source alternative? or a cheaper alternative.
View 1 Replies