That is because you are not using a server control. If you simply write out the html code for the control, the runat and onserverclick properties simply ends up in the html code, where they are totally meningless. The runat and onserverclick properies only work if you have them in code that is parsed into the page.
In this case I would simply create server objects for the elements, add the event to the OnClickproperty of the button, and add the objects into a Controls collection of an element in the page.
Thank you for the prompt reply. I did not get you clearly. I would be very happy if you could brief little more on this with some example code. I once again thank you for the reply. (I am waiting for your reply).
You said that i need to make the "image button" as a server control, which I had already done in the above code (the attribute in the bold text).
Thanks in advance. Please reply soon. I am eagerly awaiting.
No, it's not a server control. It's just some text in a string. Just because the string contains "runat='server'" doesn't mean that anything happens. The string could just as well contain "kill all humans", but that wouldn't happen either.
To be a server control it has to be a real object, in this case an HtmlInputImage object.
There are generally two ways of creating server controls:
1. Put the tag in the aspx page so that it is parsed into the Page object.
2. Create the object in the code behind and add it to the page structure.
Not directly. Consider these two rules:
1. The server side code and the client side code never exist in the same place.
2. The server side code and the client side code never exist at the same time.
I have a problem, which now I don't have any kinds of solution of it.
My program is minimizing into the tray and becomes invisible in the Windows taskbar. It happends this way:
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
And after this actions I cannot shutdown the computers or restart the system until I unload (close)my program by hand.
Could you give me an advise what to do to solve my trouble.
I take it you're handing the form's Closing event and cancelling the Close so you can, instead, minimize the form? This is where your problem is. Since your cancelling the Close, your app never closes and it causes Windows to abort the Logoff/Shutdown.
You might want to read this[^] little tidbit under "System Notification Tray".
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
i have a number of Richtext boxes which i have arranged
in a tabular manner and i want to print the contents of
these richtextboxes with the formatted text in them.
i have tried the selecting each character one by one and
passing the character, it's font and color to
the Graphics.Drawstring() method.
The problem that i am facing is the font and color applied
to the whole text is that of the first character in the richtextbox
Please if anyone can help me to print the words with
it's own font and color.