468,511 Members | 1,514 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,511 developers. It's quick & easy.

Default values in Reference.cs

I want to be able to set some default values in my web application
....like..setting all strings to "" and all integers to int.MinValue....etc...

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.
Nov 23 '05 #1
4 4246
John Scott wrote:
I want to be able to set some default values in my web application
...like..setting all strings to "" and all integers to int.MinValue....etc...
Cant you do that in the Init method?

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.


Nov 23 '05 #2
John Scott wrote:
I want to be able to set some default values in my web application
...like..setting all strings to "" and all integers to int.MinValue....etc...
Cant you do that in the Init method?

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.


Nov 23 '05 #3
There is no Init medthod in the Reference.cs file...the Reference.cs is for
the Reference.map file under the Web Refernces folder in Soluction
Explorer...it is for mapping web application objects based on webservice
classes...I could create a GetNewOjbect webservice method...in which I could
send back a populated object with default values...but I want to try and make
as few calls to the webservice as possible and let the application do most of
the work.

Thanks for the reply though.
John Scott.

"ja*****@texeme.com" wrote:
John Scott wrote:
I want to be able to set some default values in my web application
...like..setting all strings to "" and all integers to int.MinValue....etc...


Cant you do that in the Init method?

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.


Nov 23 '05 #4
There is no Init medthod in the Reference.cs file...the Reference.cs is for
the Reference.map file under the Web Refernces folder in Soluction
Explorer...it is for mapping web application objects based on webservice
classes...I could create a GetNewOjbect webservice method...in which I could
send back a populated object with default values...but I want to try and make
as few calls to the webservice as possible and let the application do most of
the work.

Thanks for the reply though.
John Scott.

"ja*****@texeme.com" wrote:
John Scott wrote:
I want to be able to set some default values in my web application
...like..setting all strings to "" and all integers to int.MinValue....etc...


Cant you do that in the Init method?

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.


Nov 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by sam | last post: by
4 posts views Thread by robert | last post: by
29 posts views Thread by John Wood | last post: by
reply views Thread by John Scott | last post: by
10 posts views Thread by Joel | last post: by
74 posts views Thread by Zytan | last post: by
10 posts views Thread by =?Utf-8?B?SmFtZXMgV29uZw==?= | last post: by
43 posts views Thread by kenneth | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.