Avatar billede longshanks Nybegynder
14. juli 2003 - 18:37 Der er 1 kommentar og
1 løsning

Problemer med en Post af Form

Jeg har lavet masser af forms før, støder dog i problemer ved post af data i en af mine usercontrols. Filen har 2 forms en serverside og en alm. i den alm har jeg et hidden felt. der skal indeholde en mængde data fra en iframe. JEg har testet at dataene hentes ind i "hidden" feltet på ordentlig vis. Dataene kommer bare ikke med over til næste side når der submittes.....kan man ikke have både en serverside form og alm i en fil?....kan det være det?
Avatar billede longshanks Nybegynder
14. juli 2003 - 18:39 #1
Koden:

<%@ import namespace="System.IO"%>
<script language="C#" runat="server">
public string imgPath = "";
public string[] imgFiles;
public string url = "";

void Page_Load(object obj, EventArgs e)
{
    url = Request.QueryString["url"];
    if(url == "")
    url = "../PageEditor/nPage.aspx?url=blank.aspx";
   
    filePath.Text = url;
   
    imgPath = Request.ServerVariables["APPL_PHYSICAL_PATH"] + "CMS\\brugerBilleder";
    imgFiles = Directory.GetFiles(imgPath);
   
    billeder.Items.Add("Vælg Billede");
    for(int i = 0; i < imgFiles.Length; i++)
    {
    if(imgFiles[i].IndexOf(".jpg") > -1 || imgFiles[i].IndexOf(".gif") > -1)
    billeder.Items.Add(imgFiles[i].Substring(imgFiles[i].LastIndexOf('\\')+1));
    }
   
    fontSize.Items.Add("Skriftstørrelse");
    for(int i = 0; i < 6; i++)
    fontSize.Items.Add(""+(1+i));
   
    fontType.Items.Add("SkriftType");
    fontType.Items.Add("Arial");
    fontType.Items.Add("Verdana");
    fontType.Items.Add("Times New Roman");
}
</script>
<script language="JavaScript" src="../ASCX/editor.js"></script>
<form style="position: absolute;left: 0px;top: 0px; z-index: 1;" action="saveDoc.aspx" method="post" id="myForm" name="myForm">
<input type="hidden" id="formHtml" >
  <table align="left" width="450" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="68"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="newPage();" src="../Billeder/PageEditor/newdoc.GIF" width="22" height="23"></td>
            <td width="23"><img src="../Billeder/PageEditor/Open.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="saveDocument();" src="../Billeder/PageEditor/Save.GIF" width="23" height="22"></td>
          </tr>
        </table></td>
      <td width="69" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('Bold');" src="../Billeder/PageEditor/Bold.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('Italic');" src="../Billeder/PageEditor/Italic.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="runCommand('Underline');" src="../Billeder/PageEditor/under.GIF" width="23" height="22"></td>
          </tr>
        </table></td>
        <td width="65" height="23">
        <table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img src="../Billeder/PageEditor/bgcolor.GIF" width="23" height="22"></td>
            <td width="23"><img src="../Billeder/PageEditor/fgcolor.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="insertImage();" src="../Billeder/PageEditor/jpg.gif" width="16" height="18"></td>
          </tr>
        </table>
    </td>
    <td width="69" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('justifyLeft');" src="../Billeder/PageEditor/left.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('justifyCenter');" src="../Billeder/PageEditor/Center.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="runCommand('justifyRight');" src="../Billeder/PageEditor/right.GIF" width="23" height="22"></td>
          </tr>
        </table> </td>
        <td width="69" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('InsertUnOrderedList');" src="../Billeder/PageEditor/bullist.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('InsertOrderedList');" src="../Billeder/PageEditor/numlist.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="runCommand('createLink');" src="../Billeder/PageEditor/Link.GIF" width="23" height="22"></td>
          </tr>
        </table> </td>
        <td width="110" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('undo');" src="../Billeder/PageEditor/Undo.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('redo');" src="../Billeder/PageEditor/Redo.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="runCommand('delete');" src="../Billeder/PageEditor/delete.GIF" width="23" height="22"></td>
          </tr>
        </table> </td>
        <td width="110" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('copy');" src="../Billeder/PageEditor/Copy.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('cut');" src="../Billeder/PageEditor/Cut.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="runCommand('paste');" src="../Billeder/PageEditor/Paste.GIF" width="23" height="22"></td>
          </tr>
        </table> </td><td width="110" height="23"><table width="26" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="23"><img onClick="setHtmlView();" src="../Billeder/PageEditor/htmlView.gif" width="23" height="22"></td>
          </tr>
        </table> </td>       
    </tr>
    <tr>
      <td width="68"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('indent');" src="../Billeder/PageEditor/inindent.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('Outdent');" src="../Billeder/PageEditor/DeIndent.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="saveDocument();" src="../Billeder/PageEditor/Find.GIF" width="23" height="22"></td>
          </tr>
        </table></td>
      <td width="69" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('Bold');" src="../Billeder/PageEditor/instable.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('Italic');" src="../Billeder/PageEditor/inscell.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="runCommand('Underline');" src="../Billeder/PageEditor/inscol.GIF" width="23" height="22"></td>
          </tr>
        </table></td>
        <td width="65" height="23">
        <table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img src="../Billeder/PageEditor/insrow.GIF" width="23" height="22"></td>
            <td width="23"><img src="../Billeder/PageEditor/spltcell.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="saveDocument();" src="../Billeder/PageEditor/mrgcell.GIF" width="23" height="22"></td>
          </tr>
        </table>
    </td>
    <td width="69" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('justifyLeft');" src="../Billeder/PageEditor/delrow.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('justifyCenter');" src="../Billeder/PageEditor/delcol.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="runCommand('justifyRight');" src="../Billeder/PageEditor/delcell.GIF" width="23" height="22"></td>
          </tr>
        </table> </td>
        <td width="69" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('InsertUnOrderedList');" src="../Billeder/PageEditor/borders.GIF" width="23" height="22"></td>
            <td width="23"><img onClick="runCommand('InsertOrderedList');" src="../Billeder/PageEditor/alert.gif" width="16" height="16"></td>
            <td width="20"><img onClick="runCommand('createLink');" src="../Billeder/PageEditor/Break.GIF" width="23" height="22"></td>
          </tr>
        </table> </td>
        <td width="110" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('undo');" src="../Billeder/PageEditor/checked.gif" width="16" height="16"></td>
            <td width="23"><img onClick="runCommand('redo');" src="../Billeder/PageEditor/details.GIF" width="23" height="22"></td>
            <td width="20"><img onClick="runCommand('delete');" src="../Billeder/PageEditor/fullscrn.GIF" width="23" height="22"></td>
          </tr>
        </table> </td>
        <td width="110" height="23"><table width="65" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22"><img onClick="runCommand('copy');" src="../Billeder/PageEditor/pdf.gif" width="16" height="18"></td>
            <td width="23"><div align="center"><img onClick="runCommand('cut');" src="../Billeder/PageEditor/planet.gif" width="10" height="10"></div></td>
            <td width="20"><img onClick="runCommand('paste');" src="../Billeder/PageEditor/psd.gif" width="16" height="18"></td>
          </tr>
        </table> </td><td width="110" height="23"><table width="26" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="23"><img onClick="runCommand('print');" src="../Billeder/PageEditor/print.GIF" width="23" height="22"></td>
          </tr>
        </table> </td>       
    </tr>
  </table>
  </form>
<form id="form1" name="form1" runat="server" style="position: absolute;left: 0px;top: 42px; z-index: 1;">
  <table width="510" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="60">
    <div align="left">
        <input style="Font-size: 10px;" name="titel" type="text" id="titel" value="Sidens Titel" size="15" maxlength="20">
    </div>
    </td>
    <td width="10">
          <asp:dropdownlist id="fontSize" font-size="10px" runat="server"></asp:dropdownlist>
    </td>
    <td width="10">
          <asp:dropdownlist id="fontType" font-size="10px" runat="server"></asp:dropdownlist>
    </td>
      <td width="10">
        <asp:dropdownlist id="billeder" font-size="10px" runat="server"></asp:dropdownlist></td>
      <td width="425">
          <select name="farver" id="farver" style="Font-size: 10px;" onchange="editorWindow.focus();">
            <option value="black">Vælg Farve</option>
            <option value="maroon" style="background-color:maroon; color:white;">Maroon</option>
            <option value="blue" style="background-color:blue; color:white;">Blå</option>
            <option value="red" style="background-color:red; color:white;">Rød</option>
            <option value="white" tyle="background-color:white; color:black;">Hvid</option>
            <option value="black" style="background-color:black; color:white;">Sort</option>
            <option value="black" style="background-color:pink; color:white;">Pink</option>
            <option value="yellow" style="background-color:yellow; color:black;">Gul</option>
            <option value="lightgrey" style="background-color:lightgrey; color:white;">lysegrå</option>
            <option value="green" style="background-color:green; color:white;">Grøn</option>
            <option value="lightblue" style="background-color:lightblue; color:white;">Lyseblå</option>
            <option value="brown" style="background-color:brown; color:white;">Brun</option>
            <option value="purple" style="background-color:purple; color:white;">Lilla</option>
            <option value="orange" style="background-color:orange; color:white;">Orange</option>
          </select>
        </div></td>
  </tr>
</table>

  <table style="position: absolute;left: 0px;top: 21px; z-index: 1;" width="550" border="0" align="left" cellpadding="0" cellspacing="0">
    <tr>
    <td height="157" align="left" valign="top"><iframe id="editWindow" src="<%=url%>" width="510" height="415"></iframe></td>
  </tr>
</table>
<asp:label style="position: absolute;left: 0px;top: 430px; z-index: 4;" id="filePath" runat="server" />
</form>
Avatar billede longshanks Nybegynder
14. juli 2003 - 22:08 #2
har fundet ud af det, manglede name="myForm" i klient side formen
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester