开发者

Facebox in asp.net - update database, using preset textbox values in the facebox

开发者 https://www.devze.com 2022-12-18 02:33 出处:网络
I\'ve been using Facebox lately, and it seems like it doesn\'t play well with asp.net. With the help from this forum, i solved the problems with retrieving values from textboxes, as well as capturing

I've been using Facebox lately, and it seems like it doesn't play well with asp.net. With the help from this forum, i solved the problems with retrieving values from textboxes, as well as capturing the event from a button inside the facebox.

Now, I have stumbled onto another strange problem. If i populate the textboxes inside the facebox wi开发者_C百科th existing values, before the facebox is opened, open the facebox, change some of the values, hit a button that graps the new values from the textboxes, the values that are grapped are the ones the textboxes were populated with before the facebox was opened.

This is the code in my .aspx page:

<a href="#facebox" rel="facebox">open facebox</a>
    <div id="facebox" style="display: none;">
        <p>
            1:&nbsp;<span><asp:TextBox ID="txt_reason1" runat="server" Width="200" TextMode="MultiLine"
                Rows="2"></asp:TextBox></span></p>
        <p>
            2:&nbsp;<span><asp:TextBox ID="txt_reason2" runat="server" Width="200" TextMode="MultiLine"
                Rows="2"></asp:TextBox></span></p>
        <p>
            3:&nbsp;<span><asp:TextBox ID="txt_reason3" runat="server" Width="200" TextMode="MultiLine"
                Rows="2"></asp:TextBox></span></p>
        <asp:Button ID="Button2" runat="server" Text="Gem" OnClick="Button2_Click" />
    </div>

Then in my codebehind, I set the textboxes (when the page loads) in the facebox like this: (_goal is a business object)

    txt_reason1.Text = _goal.GoalReason1;
    txt_reason2.Text = _goal.GoalReason2;
    txt_reason3.Text = _goal.GoalReason3;

I then change some values in the .aspx and hit the button with this code in the eventhandler:

    _goal.GoalReason1 = txt_reason1.Text;
    _goal.GoalReason2 = txt_reason2.Text;
    _goal.GoalReason3 = txt_reason3.Text;
    bool res = GoalManager.UpdateGoal(_goal);

which pretty much just sets some object properties with the textbox values, and updates the database with it. But, the textbox values are not changed, and I checked it using the debugger. My guess is that facebox is somehow denying the textboxes to be changed. I don't know, so I was hoping that someone in here knows more about facebox, and maybe even solved this problem...


Did not find a solution in this thread. Closed....

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号