WebServices: where to update data in asp.net page

GoyoGoyo Posts: 41Member
edited 2012-06-09 in NAV Three Tier
Hello. I'm starting with web services and I'm facing a problem I can't solve or find documentation anywhere.

I'm developing a web page and showing a Job Card. I want the users to update data, and I want data to be saved in Nav database, but I don't know how to do it. I'm using TextBox to show the fields, and I've tried the Update method from the WebService with fixed values, but I don't know where I have to execute this Update method, because when I call it, the data has disappeared because of the PostBack. I've even tried with CustomValidators, but I don't get any positive result.

I've also search for help on the internet but I can't find an example for doing that, and I think it has to be some easy way to do that but it's only I can't find it.

Where should I put the Update?

Answers

  • yukonyukon Posts: 332Member
    Hi Goyo,

    I think your problem is not related with NAV Ws. :)
    I've tried the Update method from the WebService with fixed values, but I don't know where I have to execute this Update method, because when I call it, the data has disappeared because of the PostBack.

    It depend on you. Because of when you want to update back to nav. Eg. Button Click Event, textbox chaged Event.
    Here is example.
    aspx
    
    <asp:TextBox ID="txt" runat="server" EnableViewState="false" AutoPostBack="true" 
                ontextchanged="txt_TextChanged"></asp:TextBox>
        <asp:Button ID="btn" runat="server" Text="Btn" onclick="btn_Click" />
    
    CB
    protected void btn_Click(object sender, EventArgs e)
        {
            //Do something for WS
            Response.Write(txt.Text);
        }
        protected void txt_TextChanged(object sender, EventArgs e)
        {
            //Do something for WS
        }
    


    You can find with this word in Google "asp.net sample projects with source code"

    WS Example
    http://blogs.msdn.com/b/freddyk/

    Asp.net
    http://forums.asp.net/

    Best Regards,
    Yukon
    Make Simple & Easy
  • GoyoGoyo Posts: 41Member
    Thank you so much for your help. With AutoPostback and OnTextChanged it finally works \:D/ . Despite all my efforts looking for a way to do that, I haven't found anything until your help. It has been very frustrating not finding anything about anything that I supossed was so common ](*,) . Thanks again.
Sign In or Register to comment.