Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Aspx.cs C# code-behind for SHARP OSA Help Please (http://www.go4expert.com/forums/aspxcs-c-sharp-code-sharp-osa-help-t26716/)

wemmert 17Sep2011 02:03

Aspx.cs C# code-behind for SHARP OSA Help Please
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====

//general code that loads page and gives you a button to push and a field to fill

public void Home_Click(object sender, ImageClickEventArgs e)

//rest of code that I would dare not change (unless someone told me how)

====aspx page====

<%@ Page Language="C#" AutoEventWireup="true" Inherits="Main2" Codebehind="Main2.aspx.cs" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="Osa.Util" %>
    <title> title here</title>
    <asp:Literal runat="server" id="activestylesheet"></asp:literal>

<form id="Form1" method="post" runat="server" >
    <asp:ImageButton ID="ImageButtonHome" runat="server"
        ImageUrl="~/Images/redo.png" style="position:absolute; top:75px; left:700px;" onClick="Home_Click" 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.

wemmert 19Sep2011 03:08

Re: Aspx.cs C# code-behind for SHARP OSA Help Please
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

All times are GMT +5.5. The time now is 00:33.