Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2008

Tip: Looking for answers? Try searching our database.

Custom Web Service w/C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cappjr@gmail.com - 22 May 2008 15:19 GMT
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
cappjr@gmail.com - 22 May 2008 15:38 GMT
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".
[quoted text clipped - 8 lines]
> Thanks!
> Jeremy
Registered User - 22 May 2008 18:58 GMT
>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
[quoted text clipped - 9 lines]
>> Thanks!
>> Jeremy
cappjr@gmail.com - 27 May 2008 21:13 GMT
> >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
[quoted text clipped - 40 lines]
>
> - Show quoted text -

Thanks for the reply. I'll give both a try.
cappjr@gmail.com - 27 May 2008 22:09 GMT
This does almost exactly what I want it to do!

http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx

> >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
[quoted text clipped - 40 lines]
>
> - Show quoted text -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.