471,349 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

Custom Web Service w/C#

Here's what I'm trying to do. I have a form with a text box called
"accountNum". I have a label under that text box called "orgName".

What I want to do, using Web Services, is when the user enters in
their account number, the Web service connects to the database and
pulls the organization name associated with that account number and
displays the results in the "orgName" label.

Can anyone help or point me in the right direction?

Thanks!
Jeremy
Jun 27 '08 #1
4 1014
Let me clarify...I'm not trying to learn how to write the Web Service
itself. I have that done already. What I'm needing is to return that
result to a Label without hitting a submit button. You know, kind of
like how the AJAX CascadingDropDown control works.

On May 22, 9:19*am, cap...@gmail.com wrote:
Here's what I'm trying to do. I have a form with a text box called
"accountNum". I have a label under that text box called "orgName".

What I want to do, using Web Services, is when the user enters in
their account number, the Web service connects to the database and
pulls the organization name associated with that account number and
displays the results in the "orgName" label.

Can anyone help or point me in the right direction?

Thanks!
Jeremy
Jun 27 '08 #2
On Thu, 22 May 2008 07:38:01 -0700 (PDT), ca****@gmail.com wrote:
>Let me clarify...I'm not trying to learn how to write the Web Service
itself. I have that done already. What I'm needing is to return that
result to a Label without hitting a submit button. You know, kind of
like how the AJAX CascadingDropDown control works.
Use asynchronous client-side javascript methods to handle the
textbox's OnTextChanged event. The script can call the web service
when the Enter key is pressed.

I do not like the idea of calling a web service from client-side
scripting. Too much information is publicly exposed about something
that may need to be a private resource. Instead I would call a page
specifically designed for the task and pass the text in the query
string.

protected void Page_Load(object sender, EventArgs e)
{
string textboxText = Request.QueryString["TextboxText"].Trim();;
string labelText - getLabelText(textboxText);

Response.Clear();
Response.Write(labelText);
Response.End();
}

Doing this keeps the async call within the scope and security of the
session.
>On May 22, 9:19*am, cap...@gmail.com wrote:
>Here's what I'm trying to do. I have a form with a text box called
"accountNum". I have a label under that text box called "orgName".

What I want to do, using Web Services, is when the user enters in
their account number, the Web service connects to the database and
pulls the organization name associated with that account number and
displays the results in the "orgName" label.

Can anyone help or point me in the right direction?

Thanks!
Jeremy
Jun 27 '08 #3
On May 22, 12:58*pm, Registered User <n4...@ix.netcom.comwrote:
On Thu, 22 May 2008 07:38:01 -0700 (PDT), cap...@gmail.com wrote:
Let me clarify...I'm not trying to learn how to write theWebService
itself. I have that done already. What I'm needing is to return that
result to a Label without hitting a submit button. You know, kind of
like how the AJAX CascadingDropDown control works.

Use asynchronous client-side javascript methods to handle the
textbox's OnTextChanged event. The script can call thewebservice
when the Enter key is pressed.

I do not like the idea of calling awebservicefrom client-side
scripting. Too much information is publicly exposed about something
that may need to be a private resource. Instead I would call a page
specifically designed for the task and pass the text in the query
string.

*protected void Page_Load(object sender, EventArgs e)
*{
* string textboxText = Request.QueryString["TextboxText"].Trim();;
* string labelText - getLabelText(textboxText);

* *Response.Clear();
* *Response.Write(labelText);
* *Response.End();

}

Doing this keeps the async call within the scope and security of the
session.
On May 22, 9:19*am, cap...@gmail.com wrote:
Here's what I'm trying to do. I have a form with a text box called
"accountNum". I have a label under that text box called "orgName".
What I want to do, usingWebServices, is when the user enters in
their account number, theWebserviceconnects to the database and
pulls the organization name associated with that account number and
displays the results in the "orgName" label.
Can anyone help or point me in the right direction?
Thanks!
Jeremy- Hide quoted text -

- Show quoted text -
Thanks for the reply. I'll give both a try.
Jun 27 '08 #4
This does almost exactly what I want it to do!

http://www.semenoff.dk/en/Code-Corne...avaScript.aspx

On May 22, 12:58*pm, Registered User <n4...@ix.netcom.comwrote:
On Thu, 22 May 2008 07:38:01 -0700 (PDT), cap...@gmail.com wrote:
Let me clarify...I'm not trying to learn how to write theWebService
itself. I have that done already. What I'm needing is to return that
result to a Label without hitting a submit button. You know, kind of
like how the AJAX CascadingDropDown control works.

Use asynchronous client-side javascript methods to handle the
textbox's OnTextChanged event. The script can call thewebservice
when the Enter key is pressed.

I do not like the idea of calling awebservicefrom client-side
scripting. Too much information is publicly exposed about something
that may need to be a private resource. Instead I would call a page
specifically designed for the task and pass the text in the query
string.

*protected void Page_Load(object sender, EventArgs e)
*{
* string textboxText = Request.QueryString["TextboxText"].Trim();;
* string labelText - getLabelText(textboxText);

* *Response.Clear();
* *Response.Write(labelText);
* *Response.End();

}

Doing this keeps the async call within the scope and security of the
session.
On May 22, 9:19*am, cap...@gmail.com wrote:
Here's what I'm trying to do. I have a form with a text box called
"accountNum". I have a label under that text box called "orgName".
What I want to do, usingWebServices, is when the user enters in
their account number, theWebserviceconnects to the database and
pulls the organization name associated with that account number and
displays the results in the "orgName" label.
Can anyone help or point me in the right direction?
Thanks!
Jeremy- Hide quoted text -

- Show quoted text -
Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Uppi | last post: by
16 posts views Thread by Bret Pehrson | last post: by
5 posts views Thread by mtv | last post: by
reply views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.