07. april 2008 - 18:54
#9
det er heller ikke meningen at jeg skal bruge ToString(), det er mere i fejlfindingen jeg har roden med lidt af hvert..
min dropdowns har ingen værdier, da den jo kører denne del af koden, før den er færdig med at loade siden..
den kode den har genereret er i aspx siden.. du kan da godt få koden her:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="edit_Guide.aspx.cs" Inherits="Guides_Add_New" Title="Untitled Page" ValidateRequest="false" %>
<%@ Register tagprefix="tinymce" Namespace="Moxiecode.TinyMCE.Web" Assembly="Moxiecode.TinyMCE" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
</LoggedInTemplate>
<AnonymousTemplate>
Du skal være logget ind for at kunne tilføje en guide
</AnonymousTemplate>
<RoleGroups>
<asp:RoleGroup Roles="admin">
<ContentTemplate>
<table style="width: 800px; background-color: wheat">
<tr>
<td style="width: 120px; height: 25px;">
Emne:
</td>
<td style="width: 680px; height: 25px;">
<asp:TextBox ID="txtTopic" runat="server" ValidationGroup="Val_Topic" Width="240px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 120px">
Hoved Kategori
<br />
</td>
<td style="width: 680px">
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"
DataTextField="Main_Cat" DataValueField="Main_Cat_ID" Width="240px">
<asp:ListItem Value="2">"Tilføj ny kategori"</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td style="width: 120px">
Under Kategori </td>
<td style="width: 680px">
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2"
DataTextField="Sub_Cat" DataValueField="Sub_Cat_ID" Width="240px" OnInit="DropDownList2_Init">
<asp:ListItem Value="1">"Tilføj Ny kategori"</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td colspan="2">
<!-- tinyMCE -->
<script language="javascript" type="text/javascript" src="../tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,pagebreak,imagemanager,filemanager",
theme_advanced_buttons1_add_before : "save,newdocument,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,spellchecker,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
content_css : "/example_data/example_full.css",
plugin_insertdate_dateFormat : "%d-%m-%Y",
plugin_insertdate_timeFormat : "%H:%M:%S",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js",
template_external_list_url : "example_data/example_template_list.js",
theme_advanced_resize_horizontal : false,
theme_advanced_resizing : true,
apply_source_formatting : true
});
</script>
<!-- /tinyMCE -->
<asp:TextBox ID="TextBox" runat="server" TextMode="MultiLine" Width="100%" Height="400px"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2">
<br />
<asp:ImageButton ID="ImageButton1" runat="server" OnClick="ImageButton1_Click" PostBackUrl="~/Guides/Default.aspx"
OnClientClick="Insert()" ImageUrl="~/Tilfoej.jpg" /></td>
</tr>
</table>
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:njepics_gamestatsConnectionString %>"
SelectCommand="SELECT [Main_Cat_ID], [Main_Cat] FROM [Group_Main_Cat]"></asp:SqlDataSource>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="System.Type"
InsertMethod="CreateObj" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="GuideTableAdapters.DataTable1TableAdapter">
<InsertParameters>
<asp:Parameter Name="Sub_Cat" />
<asp:Parameter Name="Main_Cat" />
<asp:Parameter Name="Topic" />
<asp:Parameter Name="Text" />
</InsertParameters>
</asp:ObjectDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:njepics_gamestatsConnectionString %>"
SelectCommand="SELECT [Sub_Cat_ID], [Sub_Cat] FROM [Group_Sub_Cat]" OnUpdated="SqlDataSource2_Updated"></asp:SqlDataSource>
</asp:Content>