表单不会将“action = edit”添加到我的网址

时间:2016-01-10 02:09:15

标签: c# webforms edit

所以我想编辑我的项目,它必须在我的部分类中调用一个动作 但它没有将“Action = edit”添加到我的网址

private Leraren docenten;
protected int id;
protected string action;

protected void Page_Load(object sender, EventArgs e)
{
    if (!ReferenceEquals(Request.QueryString["id"], null))
    {
        id = int.Parse(Request.QueryString["id"]);

        if (Request.QueryString["action"] == "edit")
        {
            update();
        }

        if (!IsPostBack)
        {
            docenten = new Leraren();
            contact.DataSource = docenten.GetTeacher(id);
            contact.DataBind();
        }

    }
    else
    {
        Response.Redirect("Default.aspx");
    }

}

Edit.aspx表格

<form action="Edit.aspx?id=<%= id %>&action=edit" method="post" class="frm-edit">
<div class="naam">
    <h1>
        <input type="text" name="txt_naam" id="txt_naam" value="
            <%#Eval("naam") %>" />
            <input type="text" name="txt_voornaam" id="txt_voornaam" value="
                <%#Eval("voornaam") %>" />
            </h1>
        </div>
        <div class="content">
            <table class="user-detail">
                <tr>
                    <td>E-mail:</td>
                    <td>
                        <input type="email" name="txt_email" id="txt_email" value="
                            <%#Eval("email") %>" />
                        </td>
                    </tr>
                    <tr>
                        <td>foto:</td>
                        <td>
                            <input type="text" name="txt_foto" id="txt_foto" value="
                                <%#Eval("foto") %>" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="button-holder">
                    <div>
                        <a href="../Wie.aspx" class="btn back">Back</a>
                    </div>
                    <div>
                        <input type="submit" class="btn ready" value="Klaar" />
                    </div>
                </div>
            </form>

请不要恨我...我正在尽我所能,但有时它只是没有成功

0 个答案:

没有答案