1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Aspx.cs C# code-behind for SHARP OSA Help Please

Discussion in 'C#' started by wemmert, Sep 16, 2011.

  1. wemmert

    wemmert New Member

    Joined:
    Sep 16, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Greetings All.

    I'm not normally a developer, and most of my C# knowledge is pretty shaky, because I haven't dealt with it since College. I essentially am having the hardest time getting an aspx.cs page to work with SHARP OSA. SHARP OSA really shouldn't mean anything, all that matters is that it is aspx.

    I'll give some background. The program I am attempting to fix, when done, takes values entered and spits out a name tag dynamically, on the screen of a copier (MFP). The only problem is that there is nothing on any of the pages that allows you to return to the beginning, forcing you to: stop, close the program, go back into the OSA, restart the program. So I am attempting to put in a "home" button that returns the user back to the beginning. My problem exists with the red colored text, the rest of the code around it is there so people can get their bearings on what I'm doing.

    ====aspx.cs page====
    Code:
    //general code that loads page and gives you a button to push and a field to fill
    
    [COLOR="Red"]public void Home_Click(object sender, ImageClickEventArgs e)
    {
    response.redirect("default.aspx");
    }[/COLOR]
    
    //rest of code that I would dare not change (unless someone told me how)
    ====aspx page====
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" Inherits="Main2" Codebehind="Main2.aspx.cs" %>
    <%@ Import Namespace="System.Threading" %>
    <%@ Import Namespace="Osa.Util" %>
    <html>
         <head>
         <title> title here</title>
         <asp:Literal runat="server" id="activestylesheet"></asp:literal>
         </head>
    
    <body>
    <form id="Form1" method="post" runat="server" >
      
        <asp:ImageButton ID="ImageButtonHome" runat="server" 
            ImageUrl="~/Images/redo.png" style="position:absolute; top:75px; left:700px;" [COLOR="red"]onClick="Home_Click"[/COLOR] Width="87px" Height="30px" />
    
    //rest of code is good and probably does not need anything


    Essentially, IF the onClick="Home_Click" argument is taken out, the code runs just find, and all I have is an image where the button is. If I put the argument back in it fails and crashes.

    Does anyone have any ideas?

    Any help would be appreciated.
     
  2. wemmert

    wemmert New Member

    Joined:
    Sep 16, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Just another note, I tried adding an error capture to the program, and weirdly enough the error happens on a completely unrelated page.

    Now I'm just pulling my hair out.

    Thank you for any replies
     

Share This Page