autopostback virker ikke på button
hejsa..jeg har et lille nybegynder problem. Jeg er sikkert kommet til at gøre noget så min autopostback ikke virker :-p
jeg har en knap som gerne skulle trigger en postback men der sker bare ikke og en skid når jeg trykker på den.
jeg håber virkelig at der er en(eller flere) her inde der kan fortælle mig hvad jeg har gjort galt.
Det er denne knap: <asp:Button ID="Button_new_user" runat="server" Text="Button" OnClick="Button_new_user_Click"/>
Den er i bunden af min contentpage.
Contentpage kode:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="user_new.aspx.cs" Inherits="admin_user_new" Title="XXXXXXXXXXXXXXX" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<center>
<br />
<div class="box">
<div class="overskrift">
Opret ny bruger
</div>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
<table border="1" cellpadding="0" cellspacing="0" style="width: 500px;">
<tr>
<td style="width: 107px; text-align: left">
Brugernavn</td>
<td style="width: 175px" align="left">
<asp:TextBox ID="Textbox_Brugernavn" runat="server" Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 107px; text-align: left">
Password</td>
<td style="width: 175px" align="left">
<asp:TextBox ID="Textbox_Password" runat="server" Width="150px" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 107px; text-align: left">
Password igen</td>
<td style="width: 175px; height: 24px" align="left">
<asp:TextBox ID="Textbox_password2" runat="server" Width="150px" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 107px; text-align: left">
Fornavn</td>
<td style="width: 175px" align="left">
<asp:TextBox ID="Textbox_Fornavn" runat="server" Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 107px; text-align: left">
Efternavn</td>
<td style="width: 175px" align="left">
<asp:TextBox ID="Textbox_Efternavn" runat="server" Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 107px; text-align: left">
Email</td>
<td style="width: 175px" align="left">
<asp:TextBox ID="Textbox_email" runat="server" Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 107px; text-align: left">
Personale nummer</td>
<td style="width: 175px" align="left">
<asp:TextBox ID="Textbox_personalenummer" runat="server" Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 107px; height: 106px; text-align: left">
Rettighedder</td>
<td style="height: 106px; width: 175px;" align="left">
<asp:DropDownList ID="DropDownList_rightslevel" runat="server" DataSourceID="SqlDataSource"
DataTextField="rights" DataValueField="id" Width="150px">
</asp:DropDownList>
<br />
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource" GridLines="Both"
RepeatDirection="Horizontal" RepeatLayout="Flow" ShowFooter="False" ShowHeader="False">
<ItemTemplate>
<asp:Label ID="rightsLabel" runat="server" Font-Bold="True" Text='<%# Eval("rights") %>'></asp:Label><br />
><asp:Label ID="rightsdefinationLabel" runat="server" Text='<%# Eval("rightsdefination") %>'></asp:Label><br />
<hr />
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
</asp:View>
<asp:View ID="View2" runat="server">
<asp:Label ID="Label1" runat="server" Text="something is wrong!! :-("></asp:Label></asp:View>
</asp:MultiView><br />
<asp:Button ID="Button_new_user" runat="server" Text="Button" OnClick="Button_new_user_Click"/>
</div></center>
<asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
SelectCommand="SELECT [id], [rights], [rightsdefination] FROM [rights]"></asp:SqlDataSource>
</asp:Content>
Og MasterPage(kan vel også være her den driller)
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>XXXXXXXXXXXXXXXXX</title>
<link href="CSTstyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="JavaScript">
function doresize(id)
{
if(id != '')
{
var width = document.body.clientWidth;// - 458;
if((width - 458) < 100)
{
width = 100
}
else
{
width = document.body.clientWidth - 462
}
document.getElementById(id).style.width = width;
}
}
</script>
</head>
<body><!--class="login"->
<form id="form1" runat="server">
<div class="frame">
<div class="header">
<div class="login" style="right: 10px; top: 80px">
Bruger:
<asp:Label ID="CurrentUserNameLabel" runat="server" OnPreRender="CurrentUserNameLabel_PreRender"
Text="Anonym"></asp:Label>
<%
//class_system systemclass = new class_system();
//Response.Write(systemclass.username());
//if (Convert.ToBoolean(Session["islogged"]) != true)
// {
// //systemclass.loguser(Request.LogonUserIdentity.Name, Request.UserHostAddress);
// Session["islogged"] = true;
// }
%>
</div>
</div>
<div class="menu_mid">
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" StaticDisplayLevels="2" style="left: 32px; top: 109px" BackColor="Transparent" BorderColor="Transparent" CssClass="menu1" DisappearAfter="10">
</asp:Menu>
</div>
<div class="main_back">
<div class="content">
<div class="sitepath">
<asp:SiteMapPath ID="SiteMapPath1" runat="server">
</asp:SiteMapPath>
</div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</div>
<div class="footer_mid">
Copyright© XXXXXXXXXXXXXXXXXXXXXXXXXXXXX</div>
</div>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</form>
</body>
</html>