views:

311

answers:

2

I am trying to learn and use an SDK for a vendor's product. Unfortunately, the documentation is sketchy and I've run into a void in my own knowledge of the .Net Framework.

I have some working code for a windows forms application and I am trying to get it working in an ASP.NET web form app. The vendor documentation implies you can do this but maybe you cannot..

Snippet from the working windows app:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using TRIMSDK;

private void ConnectUserBtn_Click(object sender, System.EventArgs e)
{
Database db = new Database();
Databases dbChooser = new Databases();
IDatabase dbI = dbChooser.ChooseOneUI(Handle.ToInt32());
if (dbI == null)
{
 return;
}
db.Id = dbI.Id;

Now here is my attempt inside click event handler for an .ASPX page:

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TRIMSDK;

protected void ConnectUserBtn_Click(object sender, EventArgs e)
{
    Database db = new Database();
    Databases dbChooser = new Databases();
    IDatabase dbI = dbChooser.ChooseOneUI(Handle.ToInt32());
    if (dbI == null)
    {
        return;
    }

I get a compile complaint in the line just above that reads "The name 'Handle' does not exist in the current context.

This part of the SDK I am trying to use displays various modal dialogs that reflect the properties of the product to facilitate "client" development. I fear it might be only "Windows clients" and that ASP.NET web apps cannot do this.

Is there something I can add to resolve this?

+1  A: 

For web apps, modal dialogs would be done at the client, usually via javascript and dhtml - not at the server (where ASP.NET code executes). So I fear that this product is indeed winforms only.

Marc Gravell
Thanks Marc. I suspected this might not be possible. I wonder if this sort of problem is what WPF (windows presentation foundation) is solving...WPF is on my [long] list of things to read up on...
John Galt
For web? "Silverlight" more than WPF - but it isn't winforms. Otherwise, ClickOnce or XBAP - lots more to read ;-p
Marc Gravell
A: 

Just pass it:

int hwnd = 0;

IDatabase dbI = dbChooser.ChooseOneUI(hwnd);