Click here to Skip to main content
15,909,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I am trying to learn MVC, so I created an ASP.Net application. Basicly, I have the realted folders.

Whatever, I created 2 web pages(WebForm) First is the default.aspx which can be thought as a menu. There is a dropdown list and this dropdown gives the user options to present other pages.

For example, when the user selects the "departmant" option from the dropdown list, the user should see the departmaents.aspx. However the page comes with an error and no data. The error is a classic aspx error.

"'/PL' Uygulamasında Sunucu Hatası.

Sayfada tek bir sunucu tarafı Form etiketi olabilir."

Here is the default.aspx' background c# code;

C#
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
    if (DropDownList1.SelectedIndex ==0)
    {   HyperLink1.Text= "Birimler";
        HyperLink1.NavigateUrl = "http://localhost:12648/PL/Birimler.aspx";
    }
    else if (DropDownList1.SelectedIndex == 1)
    {
        HyperLink1.Text = "Personel";
        HyperLink1.NavigateUrl = "http://localhost:12648/PL/Personel.aspx";
    }
    else if (DropDownList1.SelectedIndex == 2)
    {
        HyperLink1.Text = "Ziyaretci Defteri";
        HyperLink1.NavigateUrl = "http://localhost:12648/PL/ZiyaretciDefteri.aspx";
    }
}


What am I missing?

I searched but couldn't resolve this. Thank you.

Emre.
Posted

1 solution

Sorry, ı have used 2 form tag in my asp script. (I have moved form elemnts from another aspx page, that is the cause of duplication)

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 461px;
        }
    </style>
</head>
<body>
    <form id="form2" runat="server">
    <div>
    
        <table class="style1">
            <tr>
                <td class="style2">
     Yeni Bölüm Ekle</td>
                <td>
                    Kayırlı Bölümller</td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:label id="Label1" runat="server" text="Bolum İsmi" xmlns:asp="#unknown"></asp:label>
                    <asp:textbox id="txtBolumİsmi" runat="server" xmlns:asp="#unknown"></asp:textbox>
                    <asp:button id="btnBolumEkle" runat="server" onclick="btnBolumEkle_Click" xmlns:asp="#unknown">
                        Text="Yeni Bölüm Ekle" />
                    <asp:label id="lblMesaj" runat="server"></asp:label>
                </asp:button></td>
                <td>
                    <asp:gridview id="GridView1" runat="server" allowpaging="True" xmlns:asp="#unknown">
                        AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" 
                        AutoGenerateSelectButton="True" BackColor="Yellow" PageSize="3">
                    </asp:gridview>
                </td>
            </tr>
            <tr>
                <td class="style2">
                     </td>
                <td>
                     </td>
            </tr>
        </table>
    
    </div>
//This form should be deleted
    </form>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
//Till here
</html>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900