|
copy everything between
#region Web Form Designer generated code
and
#endregion
and move it inside the } brace just above where #region currently is.
|
|
|
|
|
cmitty wrote:
#region Web Form Designer generated code
LINE 75 >>> override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
This code block should be inside the class declaration. Move it a few lines up ( just before the last '}') and it'll work.
Yes, even I am blogging now!
|
|
|
|
|
Hi,
thank you for you quick response. I do not fully understand what you mean. I have tried moving it afew lines up but no joy. ths code is automaticlly generated. I have included all my code below. You may be able to see where I am going wrong. its bugging me now huh. Thanks for your help.
Chris
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
//I removed using System.Drawing from here
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace FriendsReunion
{
public class _Default : System.Web.UI.Page
{
protected FriendsReunion.SubHeader ccSubHeader;
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
private void Page_Load(object sender, System.EventArgs e)
{
Table tb = new Table();
TableRow row;
TableCell cell;
Image img;
Hyperlink lnk;
if (Context.User.Identity.IsAuthenticated)
{
//Create a new blank table row
row = new TableRow();
//Set up the News image
img = new Image();
img.ImageUrl = "Images/globe.gif";
img.ImageAlign = ImageAlign.Middle;
img.Width = new Unit(24, UnitType.Pixel);
img.Height = new Unit(24,UnitType.Pixel);
//Create a cell and add the image
cell = new TableCell();
cell.Controls.Add(img);
//Add the new cell to the row
row.Cells.Add(cell);
//Set up the News link
lnk = new HyperLink();
lnk.Text = "News";
lnk.NavigateUrl = "News.aspx";
//Create the cell and the add link
cell = new TableCell();
cell.Controls.Add(lnk);
//Add the new cell to the row
row.Cells.Add(cell);
//Add the row to the table
tb.Rows.Add(row);
}
else
{
//code for authenticated users here...
}
//Finally, add the table to the placeholder
phNav.Controls.Add(tb);
}
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
InitializeComponent1();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent1()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
|
|
|
|
|
I have just made a control that is resizable. The resizing is performed with the mouse, in the normal windows way. You put the mouse on the resizer box and drag it to desired shape.
I have currently made this work for bottom and the right side of the control. When I resize using those resizers everything works fine. When I drag them with the mouse the control is smoothly updated. Here I update the controls width and height properties.
But when I try to do the same thing with the top and left side of the control, things dont work as with the bottom and right side. The control gets strange shapes until I release the mouse button and still it doesnt get the correct shape as I would expect. It kind of works, it resizes in the right directions atleast, but not always in the correct distances, and the resize is definately not smooth, it looks completely screwed up during the resize and flickers and everything. The only difference I can see between these edges of the control and the bottom and right is that the top and left sides need to change the controls Top and Left properties and not just its Width and Height. The code is basically exactly the same for all resizes so it seems really strange to me.
|
|
|
|
|
Check your OnPaint Event, most likely you have overridden it, maybe excessive use of Invalidate ?
~Alexander Kent
|
|
|
|
|
Yes I have overridden the OnPaint event, and I really dont know whether the use of invalidate is excessive or not, but it works for the bottom and right sides of the control, and I invalidate them just as much as I invalidate the top and left sides.
The source code is maybe a little too long to show here but if anyone wants to see it I'll be glad to send it to you.
|
|
|
|
|
Keen to take a look at your code
~Alexander Kent
|
|
|
|
|
Hi there
Iam trying to compile a simple vector draw program, but when shapes are drawn it will not give a smooth picture of the shape, i have heared that rubberbanding is the way to do it but haven't had any succes.
Can anyone shed some light on it for me
Many thanks
Sam
|
|
|
|
|
Are you using the WebImageViewer? It has a build in rubberband
~Alexander Kent
|
|
|
|
|
I have a C# application, which is using a several dlls. Sometimes one of dll's is missing, then exception is thrown with message like "The "name.dll" one of it's dependencies is missing". In this case the user (and me) doesn'n know which dll is missing. How can I get it's name at run time?
|
|
|
|
|
|
i've a problem on writing a source code for a bus company with 2 choices:
When invoked the program should present the user with two choices and let user
choose by inputting corresponding number:
1.Make a reservation
2.Sell a ticket.
If user choose (1) the program should,
1.Prompt user to input Bus name and find the file with that name, if not found create
a binary file with given name for keeping reservations for that bus.
2.Create a structure with all information needed to record a reservation.
3.Check for consistency that the seat is not taken already and the bus is not full.
4.Write the reservation into the binary file for chosen bus maintaining consistency.
5.Thank the user and exit.
If user choose (2) the program should,
1.Ask the user to input the name of bus in which reservation was previously made.
2.If the bus file does not exist, inform the user of the problem and repeat step 1.
3.Ask user input name and seat number reserved
4.If name and seat number are correct, mark the seat as sold and record amount of
money paid for the seat.
5.Finally the program should thank the user for using the program and display a
pretty report showing the current status of chosen bus in terms of which seats are
reserved, which ones for which the ticket is sold and total revenue collected so far.
nkacha
|
|
|
|
|
And what are your concrete problems or do you expect us to write the whole application for you?
www.troschuetz.de
|
|
|
|
|
This looks a lot like a homework assignment.
We can help you if you post specific questions, but we'll not code your entire application
Yes, even I am blogging now!
|
|
|
|
|
hi man,
so you have C# in school? Where's the problem? Screen IO? System.Console ...
File IO? System.IO.File ... Algorithm? If it is so, don't drink so much alcohol, or get some sleep, student!
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Nice job of cutting and pasting your homework assignment! Unless you start writing the code yourself, you will never get any help from us. We help those who help themselves.
Now, if you want someone to write your program for you, just send a cashiers check for $5,000.00US, drawn on a US bank.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i am using a vc++ 6.0 dll that is returning a 8 bit per pixel graycsale image byte buffer that i want to display into my picturebox
currently i am using
System.Drawing.Bitmap NewBmp=new Bitmap(640,480,640,System.Drawing.Imaging.PixelFormat.Format8bppIndexed ,(System.IntPtr)buff);
my image is grayscale and the format but the constructor is accepting is only Format8bppIndexed which is collored hence macking mess with my bitmap colors
i also tried to use stream but my buffer is not being converted to bitmap and eror is recieved
can anybody help me show my 8bpp inage byte buffer (byte*)in picture box
thanks
|
|
|
|
|
Does anyone actually know how to create a timelimited try out version of an application that is supposed to work offline?
Considerations: I can't really trust the computer clock because of the possibility that the user can easily change it to gain more time for the application
|
|
|
|
|
Software protection is hard. There are tons of good (and bad) articles about it on the web, I suggest you to search on Google about it.
Depending on the price of your product, you can use a hard-lock such as a HASP4-Time that has an embedded, unchangeable, clock.
You can trust the machine's clock, but only to measure time spent inside the program, not between invocations.
Yes, even I am blogging now!
|
|
|
|
|
I think i solved parts of the problem. You can always get the number of ticks that has elapsed since a reference date i think it is first of January 1973. So that should solve the problem, since you are no longer independant of what date or time the clock is set to.
However another problem remains and i'm afraid it can not be solved completely. How do you asure that the application has already been installed and used on a computer?
You can put a registry key that tells that the application has been installed on the computer. However if someone finds out that key, he can just delete it and the application will start up thinking it is the first time it is started on that computer. Of course you can hide that key really well leaving a difficult task for the hacker but still... there is no 100% secure way of insuring that the application has been installed only once.
|
|
|
|
|
Hmitosh wrote:
I think i solved parts of the problem. You can always get the number of ticks that has elapsed since a reference date i think it is first of January 1973. So that should solve the problem, since you are no longer independant of what date or time the clock is set to.
That is the clock! You have to count the number of ticks that go by while you app is running. You cannot depend on any system clocks, only the tick of a timer internal to your app.
Hmitosh wrote:
However another problem remains and i'm afraid it can not be solved completely. How do you asure that the application has already been installed and used on a computer?
You can put a registry key that tells that the application has been installed on the computer. However if someone finds out that key, he can just delete it and the application will start up thinking it is the first time it is started on that computer. Of course you can hide that key really well leaving a difficult task for the hacker but still...
There's the problem! For which is there no solution.
Hmitosh wrote:
there is no 100% secure way of insuring that the application has been installed only once.
You said it yourself...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have a problem I've been trying to solve for a couple of days now. I posted it before but couldn't get an answer that worked so I'm trying again.
I'm serializing an arraylist containing my own classes to a file. It works just fine. I can deserialize this again solong as the application doing the deserializing is the same as the one doing the serializing. When trying to deserialize in another application I get an invalidcastexception, as far as I can see this is because the programname saved in the file is not the same as the programname trying to deserialize. Can someone please tell me if and how I can work around this?
Thanks!
Andreas Färnstrand
|
|
|
|
|
|
Thanks Daniel!
With some modifications that worked perfectly.
Andreas Färnstrand
|
|
|
|
|
Hi,
I need to access a PCI I/O Card. A sys-Driver is installed, the card is visible
within the system.
Does anybody have an idea?
thanks in advance
Jörg
|
|
|
|