473,473 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Windows App v. ASP.Net App

I'm working with an SDK from a commercial software
vendor and am using a sample Windows Application
written in C# to learn the SDK (they do not have an
ASP.Net example). I need to create an ASP.Net Web
Application and have noticed that I'm having to ToString
the object references. For example, the following works
in the samle code:
// Get the list from the server
foreach (LoanFolder folder in Globals.Session.Loans.Folders)
lstFolders.Items.Add(folder);

but it must be converted to this:
// Get the list from the server
foreach (LoanFolder folder in Globals.Session.Loans.Folders)
lstFolders.Items.Add(folder.ToString());

to work in ASP.Net. So this call from the SDK:
LoanIdentityList loans = parentFolder.GetContents();
turns into:
LoanIdentityList loans =
Globals.Session.Loans.Folders[parentFolder].GetContents();
What's the fundamental difference between the two types of
applications that require the changes?
Thanks
Mar 20 '06 #1
3 1882
The difference is that you are referring to 2 different listbox controls.
In a Windows Forms project, you are using the System.Windows.Forms.Listbox
control, which has an Items collection that exposes an Add method. This Add
method only allows Objects to be passed to it and a Folder is an Object, so
your syntax: lstFolders.Items.Add(folder); works just fine.

In an ASP.NET Web Project, you are using the
System.Web.UI.WebConrols.Listbox control, which also exposes an Items
collection that has an Add method as well. But, this Add method only
accepts ListItem objects or Strings. Since your Folder is not a ListItem
object, you must treat it as a string, hence ToString is needed.

The bottom line is that in an ASP.NET Web application, you will be using
different controls than in a Windows Forms application and although you will
see controls that look the same in both kinds of projects, they are not the
same controls and may have differences between them.

-Scott
"Garth Wells" <no****@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I'm working with an SDK from a commercial software
vendor and am using a sample Windows Application
written in C# to learn the SDK (they do not have an
ASP.Net example). I need to create an ASP.Net Web
Application and have noticed that I'm having to ToString
the object references. For example, the following works
in the samle code:
// Get the list from the server
foreach (LoanFolder folder in Globals.Session.Loans.Folders)
lstFolders.Items.Add(folder);

but it must be converted to this:
// Get the list from the server
foreach (LoanFolder folder in Globals.Session.Loans.Folders)
lstFolders.Items.Add(folder.ToString());

to work in ASP.Net. So this call from the SDK:
LoanIdentityList loans = parentFolder.GetContents();
turns into:
LoanIdentityList loans =
Globals.Session.Loans.Folders[parentFolder].GetContents();
What's the fundamental difference between the two types of
applications that require the changes?
Thanks

Mar 20 '06 #2
Thanks for the quick reply. I've only done ASP/ASP.Net development, so
converting the app with the limited samples and poor documentation is
difficult.

Let me ask you one more thing. The following:
LoanIdentityList loans = parentFolder.GetContents();
returns a GUID in the windows app, but the converted line returns
a string.

LoanIdentityList loans =
Globals.Session.Loans.Folders[parentFolder].GetContents();

and the list is loaded with:

foreach (LoanIdentity id in loans)
lstLoans.Items.Add(id.ToString)

Obviously GetContents() returns LoanIdentity, but whats the best way to tell if
it
returns any other values. The documentation does not describe the collections
and
methods.

Thanks Again.


"Scott M." <s-***@nospam.nospam> wrote in message
news:#w**************@TK2MSFTNGP11.phx.gbl...
The difference is that you are referring to 2 different listbox controls.
In a Windows Forms project, you are using the System.Windows.Forms.Listbox
control, which has an Items collection that exposes an Add method. This Add
method only allows Objects to be passed to it and a Folder is an Object, so
your syntax: lstFolders.Items.Add(folder); works just fine.

In an ASP.NET Web Project, you are using the
System.Web.UI.WebConrols.Listbox control, which also exposes an Items
collection that has an Add method as well. But, this Add method only
accepts ListItem objects or Strings. Since your Folder is not a ListItem
object, you must treat it as a string, hence ToString is needed.

The bottom line is that in an ASP.NET Web application, you will be using
different controls than in a Windows Forms application and although you will
see controls that look the same in both kinds of projects, they are not the
same controls and may have differences between them.

-Scott
"Garth Wells" <no****@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I'm working with an SDK from a commercial software
vendor and am using a sample Windows Application
written in C# to learn the SDK (they do not have an
ASP.Net example). I need to create an ASP.Net Web
Application and have noticed that I'm having to ToString
the object references. For example, the following works
in the samle code:
// Get the list from the server
foreach (LoanFolder folder in Globals.Session.Loans.Folders)
lstFolders.Items.Add(folder);

but it must be converted to this:
// Get the list from the server
foreach (LoanFolder folder in Globals.Session.Loans.Folders)
lstFolders.Items.Add(folder.ToString());

to work in ASP.Net. So this call from the SDK:
LoanIdentityList loans = parentFolder.GetContents();
turns into:
LoanIdentityList loans =
Globals.Session.Loans.Folders[parentFolder].GetContents();
What's the fundamental difference between the two types of
applications that require the changes?
Thanks


Mar 21 '06 #3
Methods may take in none, one or many different sets of arguments
(overloading), but methods can only RETURN one type. So, if GetContents()
returns a LoanIdentity type, then that is the only thing it can return.

"Garth Wells" <no****@nowhere.com> wrote in message
news:e2*************@TK2MSFTNGP10.phx.gbl...
Thanks for the quick reply. I've only done ASP/ASP.Net development, so
converting the app with the limited samples and poor documentation is
difficult.

Let me ask you one more thing. The following:
LoanIdentityList loans = parentFolder.GetContents();
returns a GUID in the windows app, but the converted line returns
a string.

LoanIdentityList loans =
Globals.Session.Loans.Folders[parentFolder].GetContents();

and the list is loaded with:

foreach (LoanIdentity id in loans)
lstLoans.Items.Add(id.ToString)

Obviously GetContents() returns LoanIdentity, but whats the best way to
tell if
it
returns any other values. The documentation does not describe the
collections
and
methods.

Thanks Again.


"Scott M." <s-***@nospam.nospam> wrote in message
news:#w**************@TK2MSFTNGP11.phx.gbl...
The difference is that you are referring to 2 different listbox controls.
In a Windows Forms project, you are using the
System.Windows.Forms.Listbox
control, which has an Items collection that exposes an Add method. This
Add
method only allows Objects to be passed to it and a Folder is an Object,
so
your syntax: lstFolders.Items.Add(folder); works just fine.

In an ASP.NET Web Project, you are using the
System.Web.UI.WebConrols.Listbox control, which also exposes an Items
collection that has an Add method as well. But, this Add method only
accepts ListItem objects or Strings. Since your Folder is not a ListItem
object, you must treat it as a string, hence ToString is needed.

The bottom line is that in an ASP.NET Web application, you will be using
different controls than in a Windows Forms application and although you
will
see controls that look the same in both kinds of projects, they are not
the
same controls and may have differences between them.

-Scott
"Garth Wells" <no****@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
> I'm working with an SDK from a commercial software
> vendor and am using a sample Windows Application
> written in C# to learn the SDK (they do not have an
> ASP.Net example). I need to create an ASP.Net Web
> Application and have noticed that I'm having to ToString
> the object references. For example, the following works
> in the samle code:
>
>
> // Get the list from the server
> foreach (LoanFolder folder in Globals.Session.Loans.Folders)
> lstFolders.Items.Add(folder);
>
>
>
> but it must be converted to this:
>
>
> // Get the list from the server
> foreach (LoanFolder folder in Globals.Session.Loans.Folders)
> lstFolders.Items.Add(folder.ToString());
>
> to work in ASP.Net. So this call from the SDK:
>
>
> LoanIdentityList loans = parentFolder.GetContents();
>
>
> turns into:
>
>
> LoanIdentityList loans =
> Globals.Session.Loans.Folders[parentFolder].GetContents();
>
>
> What's the fundamental difference between the two types of
> applications that require the changes?
>
>
> Thanks
>
>



Mar 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
7
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception:...
1
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
0
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. The program I'm trying to develop needs to be able to do the following: - Select remote server -...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
2
by: sambo251 | last post by:
After running a few updates I get this very annoying "Windows Installer" error #1706 that will ne go away! It keeps saying that it cannot find the file "instantsharedevices.msi", that it is on...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.